Skip to content

Commit af3fb0f

Browse files
authored
fix deprecations (#44)
1 parent 2f45e5e commit af3fb0f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

REQUIRE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.6.0
2-
Compat 0.55
2+
Compat 0.62

src/buffer.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mutable struct Buffer
2727
total::Int64
2828

2929
function Buffer(size::Integer)
30-
return new(Vector{UInt8}(uninitialized, size), 0, 1, 1, 0)
30+
return new(Vector{UInt8}(undef, size), 0, 1, 1, 0)
3131
end
3232

3333
function Buffer(data::Vector{UInt8})

src/stream.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ end
276276
function Base.readuntil(stream::TranscodingStream, delim::UInt8)
277277
ready_to_read!(stream)
278278
buffer1 = stream.state.buffer1
279-
ret = Vector{UInt8}(uninitialized, 0)
279+
ret = Vector{UInt8}(undef, 0)
280280
filled = 0
281281
while !eof(stream)
282282
p = findbyte(buffer1, delim)
@@ -347,7 +347,7 @@ end
347347

348348
function Base.readavailable(stream::TranscodingStream)
349349
n = bytesavailable(stream)
350-
data = Vector{UInt8}(uninitialized, n)
350+
data = Vector{UInt8}(undef, n)
351351
unsafe_read(stream, pointer(data), n)
352352
return data
353353
end

test/codecnoop.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@test eof(stream)
55
@inferred eof(stream)
66
@test read(stream) == UInt8[]
7-
@test contains(repr(stream), "mode=read")
7+
@test occursin("mode=read", repr(stream))
88

99
source = IOBuffer("foo")
1010
stream = TranscodingStream(Noop(), source)
@@ -21,20 +21,20 @@
2121

2222
stream = TranscodingStream(Noop(), IOBuffer())
2323
@test_throws EOFError read(stream, UInt8)
24-
@test_throws EOFError unsafe_read(stream, pointer(Vector{UInt8}(uninitialized, 3)), 3)
24+
@test_throws EOFError unsafe_read(stream, pointer(Vector{UInt8}(undef, 3)), 3)
2525
close(stream)
2626

2727
stream = TranscodingStream(Noop(), IOBuffer("foobar"), bufsize=1)
2828
@test read(stream, UInt8) === UInt8('f')
29-
data = Vector{UInt8}(uninitialized, 5)
29+
data = Vector{UInt8}(undef, 5)
3030
unsafe_read(stream, pointer(data), 5) === nothing
3131
@test data == b"oobar"
3232
close(stream)
3333

3434
sink = IOBuffer()
3535
stream = TranscodingStream(Noop(), sink)
3636
@test write(stream, "foo") === 3
37-
@test contains(repr(stream), "mode=write")
37+
@test occursin("mode=write", repr(stream))
3838
flush(stream)
3939
@test take!(sink) == b"foo"
4040
close(stream)

test/codecquadruple.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ end
6565
close(stream2)
6666

6767
stream = TranscodingStream(QuadrupleCodec(), IOBuffer("foo"))
68-
@test_throws EOFError unsafe_read(stream, pointer(Vector{UInt8}(uninitialized, 13)), 13)
68+
@test_throws EOFError unsafe_read(stream, pointer(Vector{UInt8}(undef, 13)), 13)
6969
close(stream)
7070
end

0 commit comments

Comments
 (0)