aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-01-17 19:38:17 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-01-17 22:20:23 +0100
commit52ee7ec0028263f04e15c05256ca90fa62a0da66 (patch)
treeda83c012767628d68462ef211a3edb0dc2df04cf
parent776eb97a4328ccfacbd4e795b4659b7367838db0 (diff)
StringSource: Use std::string_view
-rw-r--r--src/libutil/serialise.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh
index b3cfb06a2..e80fb9ecf 100644
--- a/src/libutil/serialise.hh
+++ b/src/libutil/serialise.hh
@@ -167,9 +167,9 @@ struct StringSink : Sink
/* A source that reads data from a string. */
struct StringSource : Source
{
- const string & s;
+ std::string_view s;
size_t pos;
- StringSource(const string & _s) : s(_s), pos(0) { }
+ StringSource(std::string_view s) : s(s), pos(0) { }
size_t read(char * data, size_t len) override;
};