Skip to content

Commit

Permalink
improve @io2str implementation (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evizero authored Nov 13, 2018
1 parent be61998 commit d2cc729
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function io2str_impl(expr::Expr)
esc(quote
$nvar = Base.IOBuffer()
$expr
Base.read(Base.seek($nvar, 0), String)
Base.String(Base.resize!($nvar.data, $nvar.size))
end)
else
:(throw(ArgumentError("Invalid use of `@io2str` macro: The given expression `$($(string(expr)))` does not contain `::IO` placeholder in a supported manner")))
Expand Down

0 comments on commit d2cc729

Please sign in to comment.