From 99666dfdfbcf62b73f8997a62e1a61a248c8310f Mon Sep 17 00:00:00 2001 From: bugdea1er Date: Fri, 8 Mar 2024 02:03:08 +0300 Subject: [PATCH] Do not convert to fs::path explicitly --- src/tmp.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 {