Skip to content

Commit

Permalink
Code review changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rofinn committed Apr 29, 2020
1 parent 1311062 commit 926b5a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/loadsave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ end
save(s; options...) = data -> save(s, data; options...)

# Allow format to be overridden with first argument
function save(df::Type{DataFormat{sym}}, f, data...; options...) where sym
function save(df::Type{DataFormat{sym}}, filename, data...; options...) where sym
libraries = applicable_savers(df)
checked_import(libraries[1])
return Base.invokelatest(save, File(DataFormat{sym}, f), data...; options...)
return Base.invokelatest(save, File(DataFormat{sym}, filename), data...; options...)
end

function savestreaming(df::Type{DataFormat{sym}}, s::IO, data...; options...) where sym
Expand All @@ -140,10 +140,10 @@ function save(df::Type{DataFormat{sym}}, s::IO, data...; options...) where sym
return Base.invokelatest(save, Stream(DataFormat{sym}, s), data...; options...)
end

function savestreaming(df::Type{DataFormat{sym}}, f, data...; options...) where sym
function savestreaming(df::Type{DataFormat{sym}}, filename, data...; options...) where sym
libraries = applicable_savers(df)
checked_import(libraries[1])
return Base.invokelatest(savestreaming, File(DataFormat{sym}, f), data...; options...)
return Base.invokelatest(savestreaming, File(DataFormat{sym}, filename), data...; options...)
end

# do-syntax for streaming IO
Expand Down
2 changes: 1 addition & 1 deletion test/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ finally
merge!(FileIO.sym2info, sym2info)
end

file_dir = joinpath(dirname(@__FILE__), "files")
file_dir = joinpath(@__DIR__, "files")
file_path = Path(file_dir)

@testset "Querying with $(typeof(fp))" for fp in (file_dir, file_path)
Expand Down
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ using FileIO
using FilePathsBase
using Test

# Because both FileIO and FilePathsBase export filename, but for our tests we only want the
# FileIO definition.
filename(x) = FileIO.filename(x)
# Both FileIO and FilePathsBase export filename, but we only want the FileIO definition.
using FileIO: filename

struct MimeSaveTestType
end
Expand Down

0 comments on commit 926b5a4

Please sign in to comment.