Skip to content

Commit

Permalink
Do not convert to fs::path explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
bugdea1er committed Mar 7, 2024
1 parent e0816c7 commit 99666df
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/tmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const fs::path&>(file), mode);
return std::ofstream(file, mode);
}
} // namespace

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 99666df

Please sign in to comment.