1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 20:16:03 +01:00

writeFull/writeFile: Use std::string_view

This commit is contained in:
Eelco Dolstra 2020-12-02 12:43:52 +01:00
parent e5cf501c77
commit aa68486112
2 changed files with 4 additions and 4 deletions

View file

@ -320,7 +320,7 @@ void readFile(const Path & path, Sink & sink)
}
void writeFile(const Path & path, const string & s, mode_t mode)
void writeFile(const Path & path, std::string_view s, mode_t mode)
{
AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, mode);
if (!fd)
@ -663,7 +663,7 @@ void writeFull(int fd, const unsigned char * buf, size_t count, bool allowInterr
}
void writeFull(int fd, const string & s, bool allowInterrupts)
void writeFull(int fd, std::string_view s, bool allowInterrupts)
{
writeFull(fd, (const unsigned char *) s.data(), s.size(), allowInterrupts);
}