diff --git a/src/tmp.cpp b/src/tmp.cpp index 2d3fac3..69c7076 100644 --- a/src/tmp.cpp +++ b/src/tmp.cpp @@ -101,7 +101,7 @@ std::ofstream stream(const tmp::file& file, bool binary, bool append) noexcept { mode |= std::ios::binary; } - return std::ofstream(static_cast(file), mode); + return std::ofstream(file, mode); } } // namespace @@ -182,10 +182,9 @@ file file::text(std::string_view prefix) { } std::ifstream file::read() const { - const fs::path& file = *this; return binary - ? std::ifstream(file, std::ios::binary) - : std::ifstream(file); + ? std::ifstream(*this, std::ios::binary) + : std::ifstream(*this); } std::string file::slurp() const {