Skip to content

Commit

Permalink
Fix Version upper bound for the takebuf_string deprecated method and … (
Browse files Browse the repository at this point in the history
#30)

* Fix Version upper bound for the takebuf_string deprecated method and also use proper way to deprecate type binding

* typo
  • Loading branch information
musm authored and bicycle1885 committed Jan 17, 2017
1 parent 65f8a31 commit 6ac5963
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
typealias EmptyStreamSource EmptyStream

Base.@deprecate EmptyStreamSource EmptyStream
Base.@deprecate_binding EmptyStreamSource EmptyStream
Base.@deprecate seekforward(stream::BufferedInputStream, n::Integer) skip(stream, n)

# emptystream.jl

if VERSION < v"0.6-"
if VERSION < v"0.6.0-dev.1256"
function Base.takebuf_array(stream::BufferedOutputStream{EmptyStream})
chunk = stream.buffer[1:stream.position-1]
stream.position = 1
return chunk
end
end

if v"0.5-" < VERSION < v"0.6-"
if v"0.5-" <= VERSION < v"0.6.0-dev.1256"
function Base.takebuf_string(stream::BufferedOutputStream{EmptyStream})
return String(takebuf_array(stream))
end
Expand Down

0 comments on commit 6ac5963

Please sign in to comment.