File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ Standard library changes
79
79
80
80
#### UUIDs
81
81
* Change ` uuid1 ` and ` uuid4 ` to use ` Random.RandomDevice() ` as default random number generator ([ #35872 ] ).
82
+ * Added ` parse(::Type{UUID}, ::AbstractString) ` method
82
83
83
84
Deprecated or removed
84
85
---------------------
Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ function UUID(s::AbstractString)
69
69
end
70
70
end
71
71
72
+ parse (:: Type{UUID} , s:: AbstractString ) = UUID (s)
73
+
72
74
73
75
let groupings = [36 : - 1 : 25 ; 23 : - 1 : 20 ; 18 : - 1 : 15 ; 13 : - 1 : 10 ; 8 : - 1 : 1 ]
74
76
global string
Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ let uuidstr = "ab"^4 * "-" * "ab"^2 * "-" * "ab"^2 * "-" * "ab"^2 * "-" * "ab"^6
117
117
uuid2 = UUID (uuidstr2)
118
118
uuids = [uuid, uuid2]
119
119
@test (uuids .== uuid) == [true , false ]
120
+
121
+ @test parse (UUID, uuidstr2) == uuid2
120
122
end
121
123
@test_throws ArgumentError UUID (" @" ^ 4 * " -" * " @" ^ 2 * " -" * " @" ^ 2 * " -" * " @" ^ 2 * " -" * " @" ^ 6 )
122
124
You can’t perform that action at this time.
0 commit comments