Skip to content

Commit

Permalink
Merge pull request #12 from jakobnissen/dokw
Browse files Browse the repository at this point in the history
Add varargs and kwargs to T(open(f, ::IO)) methods
  • Loading branch information
jakobnissen authored Jul 29, 2022
2 parents 6edb58e + 97d6bcb commit b99d19c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module IO
"Abstract formatted input/output type."
abstract type AbstractFormattedIO end

function (::Type{T})(f, io::Base.IO) where {T <: AbstractFormattedIO}
fmt = T(io)
function (::Type{T})(f::Function, io::Base.IO, args...; kwargs...) where {T <: AbstractFormattedIO}
fmt = T(io, args...; kwargs...)
try
f(fmt)
finally
Expand Down

0 comments on commit b99d19c

Please sign in to comment.