File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
name : csuuid
2
- version : 0.2.2
2
+ version : 0.2.3
3
3
4
4
authors :
5
5
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ describe CSUUID do
8
8
uuid.to_s.should match CHECKUUID
9
9
end
10
10
11
+ it " to_s should function correctly" do
12
+ uuid = CSUUID .new
13
+ uuid.to_s.should eq " #{ uuid } "
14
+ end
15
+
11
16
it " creates a UUID from another UUID" do
12
17
uuid_1 = CSUUID .new
13
18
uuid_2 = CSUUID .new(uuid_1)
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ require "crystal/spin_lock"
40
40
# ```
41
41
#
42
42
struct CSUUID
43
- VERSION = " 0.2.2 "
43
+ VERSION = " 0.2.3 "
44
44
45
45
@@mutex = Crystal ::SpinLock .new
46
46
# @@mutex = Mutex.new(protection: Mutex::Protection::Reentrant)
@@ -164,8 +164,8 @@ struct CSUUID
164
164
end
165
165
166
166
# Return the String representation of the UUID.
167
- def to_s : String
167
+ def to_s (io : IO ) : Nil
168
168
hs = @bytes .hexstring
169
- " #{ hs[0 ..7] } -#{ hs[8 ..11] } -#{ hs[12 ..15] } -#{ hs[16 ..19] } -#{ hs[20 ..31] } "
169
+ io << " #{ hs[0 ..7] } -#{ hs[8 ..11] } -#{ hs[12 ..15] } -#{ hs[16 ..19] } -#{ hs[20 ..31] } "
170
170
end
171
171
end
You can’t perform that action at this time.
0 commit comments