aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-24 00:44:57 +0100
committereldritch horrors <pennae@lix.systems>2024-07-05 22:28:16 +0000
commitf4f6d1d8e24a092422fcec601e21683179b735c9 (patch)
treee90edb17aea9aefc7449d1b3723ffb3b0a5bec59 /src/nix
parent06220a71c1430c97bfcd8012b00530a987e40e97 (diff)
libutil: convert readFileSource to a generator
Change-Id: I5f92b15fd367d46eb047d74ab6e317b4f51a46d3
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/add-to-store.cc2
-rw-r--r--src/nix/hash.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index f7e3212be..7e16e12c3 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -37,7 +37,7 @@ struct CmdAddToStore : MixDryRun, StoreCommand
Hash hash = narHash;
if (ingestionMethod == FileIngestionMethod::Flat) {
HashSink hsink(htSHA256);
- readFileSource(path)->drainInto(hsink);
+ hsink << readFileSource(path);
hash = hsink.finish().first;
}
diff --git a/src/nix/hash.cc b/src/nix/hash.cc
index 8d4bc7826..d9079d551 100644
--- a/src/nix/hash.cc
+++ b/src/nix/hash.cc
@@ -85,7 +85,7 @@ struct CmdHashBase : Command
switch (mode) {
case FileIngestionMethod::Flat:
- readFileSource(path)->drainInto(*hashSink);
+ *hashSink << readFileSource(path);
break;
case FileIngestionMethod::Recursive:
*hashSink << dumpPath(path);