File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ module Crystal::System::Random
42
42
if @@getrandom_available
43
43
buf = uninitialized UInt8 [1 ]
44
44
getrandom(buf.to_slice)
45
- buf.to_unsafe.as (UInt8 * ).value
45
+ buf.unsafe_as (UInt8 )
46
46
elsif urandom = @@urandom
47
47
urandom.read_byte.not_nil!
48
48
else
Original file line number Diff line number Diff line change @@ -149,14 +149,14 @@ module IO::ByteFormat
149
149
buffer = uninitialized UInt8 [{{bytesize}}]
150
150
io.read_fully(buffer.to_slice)
151
151
buffer.reverse! unless SystemEndian == self
152
- buffer.to_unsafe.as( Pointer ( {{type .id}})).value
152
+ buffer.unsafe_as( {{type .id}})
153
153
end
154
154
155
155
def self.decode (type : {{type .id}}.class, bytes : Bytes )
156
156
buffer = uninitialized UInt8 [{{bytesize}}]
157
157
bytes.to_slice[0 , {{bytesize}}].copy_to(buffer.to_slice)
158
158
buffer.reverse! unless SystemEndian == self
159
- buffer.to_unsafe.as( Pointer ( {{type .id}})).value
159
+ buffer.unsafe_as( {{type .id}})
160
160
end
161
161
{% end % }
162
162
end
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ module Random::Secure
45
45
end
46
46
else
47
47
random_bytes(buf.to_slice)
48
- buf.to_unsafe.as ({{type }}* ).value
48
+ buf.unsafe_as ({{type }})
49
49
end
50
50
end
51
51
{% end % }
You can’t perform that action at this time.
0 commit comments