From 926b5a4fa5c438deb3ca21691891049831d31d97 Mon Sep 17 00:00:00 2001 From: rofinn Date: Wed, 29 Apr 2020 15:48:33 -0500 Subject: [PATCH] Code review changes. --- src/loadsave.jl | 8 ++++---- test/query.jl | 2 +- test/runtests.jl | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/loadsave.jl b/src/loadsave.jl index 5a22aae7..c3b14af8 100755 --- a/src/loadsave.jl +++ b/src/loadsave.jl @@ -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 @@ -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 diff --git a/test/query.jl b/test/query.jl index 25128e1a..3ffcdc56 100644 --- a/test/query.jl +++ b/test/query.jl @@ -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) diff --git a/test/runtests.jl b/test/runtests.jl index 354e8673..aa39fb21 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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