aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-01-17 19:28:42 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-01-17 22:20:23 +0100
commit776eb97a4328ccfacbd4e795b4659b7367838db0 (patch)
treecb7392197526d041b8da783ea1cb8253168b0c22 /src
parent008ddef4b08e9bee530a5a4c597c88b344089021 (diff)
serialise.hh: Use std::string_view
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build/derivation-goal.cc2
-rw-r--r--src/libutil/error.hh2
-rw-r--r--src/libutil/serialise.cc2
-rw-r--r--src/libutil/serialise.hh4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index d34e53fe8..151217b8b 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -278,7 +278,7 @@ void DerivationGoal::outputsSubstitutionTried()
if (nrFailed > 0 && nrFailed > nrNoSubstituters + nrIncompleteClosure && !settings.tryFallback) {
done(BuildResult::TransientFailure,
- fmt("some substitutes for the outputs of derivation '%s' failed (usually happens due to networking issues); try '--fallback' to build derivation from source ",
+ Error("some substitutes for the outputs of derivation '%s' failed (usually happens due to networking issues); try '--fallback' to build derivation from source ",
worker.store.printStorePath(drvPath)));
return;
}
diff --git a/src/libutil/error.hh b/src/libutil/error.hh
index ff58d3e00..6fe5e4857 100644
--- a/src/libutil/error.hh
+++ b/src/libutil/error.hh
@@ -137,7 +137,7 @@ public:
{ }
template<typename... Args>
- BaseError(const std::string & fs, const Args & ... args)
+ explicit BaseError(const std::string & fs, const Args & ... args)
: err { .level = lvlError, .msg = hintfmt(fs, args...) }
{ }
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc
index 16f3476c2..704359b4a 100644
--- a/src/libutil/serialise.cc
+++ b/src/libutil/serialise.cc
@@ -325,7 +325,7 @@ void writeString(std::string_view data, Sink & sink)
}
-Sink & operator << (Sink & sink, const string & s)
+Sink & operator << (Sink & sink, std::string_view s)
{
writeString(s, sink);
return sink;
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh
index 0fe6e8332..b3cfb06a2 100644
--- a/src/libutil/serialise.hh
+++ b/src/libutil/serialise.hh
@@ -317,10 +317,10 @@ inline Sink & operator << (Sink & sink, uint64_t n)
return sink;
}
-Sink & operator << (Sink & sink, const string & s);
+Sink & operator << (Sink & in, const Error & ex);
+Sink & operator << (Sink & sink, std::string_view s);
Sink & operator << (Sink & sink, const Strings & s);
Sink & operator << (Sink & sink, const StringSet & s);
-Sink & operator << (Sink & in, const Error & ex);
MakeError(SerialisationError, Error);