Skip to content

Commit

Permalink
Add a string constructor to VersionNumber
Browse files Browse the repository at this point in the history
I feel this is more natural than `convert(VersionNumber, mystring)`, but maybe there was a design reason behind this
  • Loading branch information
IainNZ committed Jul 2, 2014
1 parent 3e2a2fa commit cee2df1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ end
VersionNumber(x::Integer, y::Integer, z::Integer) = VersionNumber(x, y, z, (), ())
VersionNumber(x::Integer, y::Integer) = VersionNumber(x, y, 0, (), ())
VersionNumber(x::Integer) = VersionNumber(x, 0, 0, (), ())
VersionNumber(s::String) = convert(VersionNumber, s)

function print(io::IO, v::VersionNumber)
v == typemax(VersionNumber) && return print(io, "")
Expand Down

0 comments on commit cee2df1

Please sign in to comment.