aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
diff options
context:
space:
mode:
Diffstat (limited to 'src/libfetchers')
-rw-r--r--src/libfetchers/path.cc6
-rw-r--r--src/libfetchers/tarball.cc2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc
index 11c952dc2..8e47616d0 100644
--- a/src/libfetchers/path.cc
+++ b/src/libfetchers/path.cc
@@ -130,10 +130,8 @@ struct PathInputScheme : InputScheme
time_t mtime = 0;
if (!storePath || storePath->name() != "source" || !store->isValidPath(*storePath)) {
// FIXME: try to substitute storePath.
- auto src = sinkToSource([&](Sink & sink) {
- mtime = dumpPathAndGetMtime(absPath, sink, defaultPathFilter);
- });
- storePath = store->addToStoreFromDump(*src, "source");
+ auto src = GeneratorSource{dumpPathAndGetMtime(absPath, mtime, defaultPathFilter)};
+ storePath = store->addToStoreFromDump(src, "source");
}
input.attrs.insert_or_assign("lastModified", uint64_t(mtime));
diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc
index c903895e2..6ce35aeb2 100644
--- a/src/libfetchers/tarball.cc
+++ b/src/libfetchers/tarball.cc
@@ -71,7 +71,7 @@ DownloadFileResult downloadFile(
storePath = std::move(cached->storePath);
} else {
StringSink sink;
- dumpString(res.data, sink);
+ sink << dumpString(res.data);
auto hash = hashString(htSHA256, res.data);
ValidPathInfo info {
*store,