1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 09:49:36 +01:00

libutil: Make HashResult a proper struct

This resolves an existing TODO and makes the
code slightly more readable.
This commit is contained in:
Sergei Zimmerman 2025-08-08 02:02:30 +03:00
parent 241420a788
commit 143bd60136
No known key found for this signature in database
18 changed files with 56 additions and 50 deletions

View file

@ -160,7 +160,7 @@ void LocalStore::optimisePath_(
{make_ref<PosixSourceAccessor>(), CanonPath(path)},
FileSerialisationMethod::NixArchive,
HashAlgorithm::SHA256)
.first;
.hash;
});
debug("'%1%' has hash '%2%'", path, hash.to_string(HashFormat::Nix32, true));
@ -175,7 +175,7 @@ void LocalStore::optimisePath_(
PosixSourceAccessor::createAtRoot(linkPath),
FileSerialisationMethod::NixArchive,
HashAlgorithm::SHA256)
.first;
.hash;
}))) {
// XXX: Consider overwriting linkPath with our valid version.
warn("removing corrupted link %s", linkPath);