Skip to content

Commit 74632fd

Browse files
committed
add small tweaks of constructors
1 parent 1e76822 commit 74632fd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/stream.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ struct TranscodingStream{C<:Codec,S<:IO} <: IO
3131
end
3232
end
3333

34+
function TranscodingStream(codec::C, stream::S, state::State) where {C<:Codec,S<:IO}
35+
return TranscodingStream{C,S}(codec, stream, state)
36+
end
37+
3438
const DEFAULT_BUFFER_SIZE = 16 * 2^10 # 16KiB
3539

3640
"""
@@ -42,11 +46,7 @@ function TranscodingStream(codec::Codec, stream::IO; bufsize::Integer=DEFAULT_BU
4246
if bufsize 0
4347
throw(ArgumentError("non-positive buffer size"))
4448
end
45-
return TranscodingStream{typeof(codec),typeof(stream)}(codec, stream, State(bufsize))
46-
end
47-
48-
function TranscodingStream(codec::Codec, stream::IO, state::State)
49-
return TranscodingStream{typeof(codec),typeof(stream)}(codec, stream, state)
49+
return TranscodingStream(codec, stream, State(bufsize))
5050
end
5151

5252
function Base.show(io::IO, stream::TranscodingStream)

0 commit comments

Comments
 (0)