Skip to content

Commit 01f649b

Browse files
committed
0.7 compat
1 parent 5115900 commit 01f649b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.juliarun_ci.sh

100755100644
File mode changed.

src/convert.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
convert(::Type{Any}, s::T) where {T<:Union{TAMQPShortStr,TAMQPLongStr,TAMQPByteArray}} = convert(String, s)
22
convert(::Type{String}, s::T) where {T<:Union{TAMQPShortStr,TAMQPLongStr,TAMQPByteArray}} = String(convert(Vector{UInt8}, s.data))
3-
convert(::Type{T}, s::AbstractString) where {T<:Union{TAMQPShortStr,TAMQPLongStr,TAMQPByteArray}} = T(length(s), Vector{UInt8}(s))
3+
convert(::Type{T}, s::AbstractString) where {T<:Union{TAMQPShortStr,TAMQPLongStr,TAMQPByteArray}} = T(length(s), Vector{UInt8}(codeunits(String(s))))
44
convert(::Type{TAMQPLongStr}, d::Vector{UInt8}) = TAMQPLongStr(length(d), d)
55
convert(::Type{TAMQPByteArray}, d::Vector{UInt8}) = TAMQPByteArray(length(d), d)
66

src/protocol.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ write(io::IO, b::TAMQPBodyPayload) = write(io, b.data)
3232

3333
function read(io::IO, ::Type{TAMQPShortStr})
3434
len = ntoh(read(io, TAMQPOctet))
35-
TAMQPShortStr(len, read!(io, Vector{UInt8}(uninitialized, len)))
35+
TAMQPShortStr(len, read!(io, Vector{UInt8}(undef, len)))
3636
end
3737

3838
function read(io::IO, ::Type{TAMQPLongStr})
3939
len = ntoh(read(io, TAMQPLongUInt))
40-
TAMQPLongStr(len, read!(io, Vector{UInt8}(uninitialized, len)))
40+
TAMQPLongStr(len, read!(io, Vector{UInt8}(undef, len)))
4141
end
4242

4343
function read(io::IO, ::Type{TAMQPByteArray})
4444
len = ntoh(read(io, TAMQPLongUInt))
45-
TAMQPByteArray(len, read!(io, Vector{UInt8}(uninitialized, len)))
45+
TAMQPByteArray(len, read!(io, Vector{UInt8}(undef, len)))
4646
end
4747

4848
write(io::IO, s::T) where {T<:Union{TAMQPShortStr,TAMQPLongStr,TAMQPByteArray}} = write(io, hton(s.len), s.data)
@@ -63,7 +63,7 @@ write(io::IO, fv::TAMQPFieldValuePair) = write(io, fv.name, fv.val)
6363
function read(io::IO, ::Type{TAMQPFieldTable})
6464
len = ntoh(read(io, fieldtype(TAMQPFieldTable, :len)))
6565
@debug("read fieldtable length $(len)")
66-
buff = read!(io, Vector{UInt8}(uninitialized, len))
66+
buff = read!(io, Vector{UInt8}(undef, len))
6767
data = TAMQPFieldValuePair[]
6868
iob = IOBuffer(buff)
6969
while !eof(iob)
@@ -102,7 +102,7 @@ function read(io::IO, ::Type{TAMQPGenericFrame})
102102
@assert hdr in (1,2,3,8)
103103
props = read(io, fieldtype(TAMQPGenericFrame, :props))
104104
@debug("reading generic frame type:$hdr, channel:$(props.channel), payloadsize:$(props.payloadsize)")
105-
payload = read!(io, TAMQPBodyPayload(Vector{TAMQPOctet}(uninitialized, props.payloadsize)))
105+
payload = read!(io, TAMQPBodyPayload(Vector{TAMQPOctet}(undef, props.payloadsize)))
106106
fend = ntoh(read(io, fieldtype(TAMQPGenericFrame, :fend)))
107107
@assert fend == FrameEnd
108108
TAMQPGenericFrame(hdr, props, payload, fend)
@@ -1177,7 +1177,7 @@ end
11771177
function on_channel_message_in(chan::MessageChannel, m::TAMQPContentHeaderFrame, ctx)
11781178
msg = chan.partial_msgs[1]
11791179
msg.properties = m.hdrpayload.proplist
1180-
msg.data = Vector{UInt8}(uninitialized, m.hdrpayload.bodysize)
1180+
msg.data = Vector{UInt8}(undef, m.hdrpayload.bodysize)
11811181
msg.filled = 0
11821182
nothing
11831183
end

src/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct TAMQPMethodPayload
141141
class = ntoh(read(io, TAMQPClassId))
142142
method = ntoh(read(io, TAMQPMethodId))
143143
args = methodargs(class, method)
144-
fields = Vector{Pair{Symbol,TAMQPField}}(uninitialized, length(args))
144+
fields = Vector{Pair{Symbol,TAMQPField}}(undef, length(args))
145145
@debug("reading method payload class:$class, method:$method, nargs:$(length(args))")
146146
bitpos = 0
147147
bitval = TAMQPBit(0)

0 commit comments

Comments
 (0)