Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate cpad #23187

Merged
merged 1 commit into from
Aug 10, 2017
Merged

deprecate cpad #23187

merged 1 commit into from
Aug 10, 2017

Conversation

fredrikekre
Copy link
Member

Alternative to #22184 / #22186

@fredrikekre fredrikekre added kind:deprecation This change introduces or involves a deprecation domain:strings "Strings!" labels Aug 9, 2017
@@ -1642,6 +1642,9 @@ end
end
end

# PR #23187
@deprecate cpad(s, n::Integer, p=" ") rpad(lpad(s,div(n+strwidth(s),2),p),n,p) false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more spaces might improve readability? :)

@@ -572,7 +572,8 @@ end

function warnbanner(msg...; label="[ WARNING ]", prefix="")
cols = Base.displaysize(STDERR)[2]
warn(prefix="", Base.cpad(label,cols,"="))
str = rpad(lpad(label,div(cols+strwidth(label),2),"="),cols,"=")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here, a few spaces might improve readability :).

NEWS.md Outdated
@@ -299,6 +299,8 @@ Deprecated or removed
* Calling `union` with no arguments is deprecated; construct an empty set with an appropriate
element type using `Set{T}()` instead ([#23144]).

* `Base.cpad` is removed; use appropriate combination of `rpad` and `lpad` instead ([#23187]).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "is removed" -> "has been removed" or "is deprecated", and perhaps "use appropriate" -> "use an appropriate"? :)

Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the followup review request! That's a great approach :).

@fredrikekre
Copy link
Member Author

Double time-out on travis...

@fredrikekre fredrikekre merged commit 01dd35a into master Aug 10, 2017
@tkelman tkelman deleted the fe/cpad branch August 18, 2017 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:strings "Strings!" kind:deprecation This change introduces or involves a deprecation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants