1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 14:10:59 +01:00

Merge branch 'hash-always-has-type' into better-ca-parse-errors

This commit is contained in:
John Ericson 2020-07-13 03:02:09 +00:00
commit c466cb2091
7 changed files with 69 additions and 21 deletions

View file

@ -92,4 +92,16 @@ std::string renderContentAddress(std::optional<ContentAddress> ca) {
return ca ? renderContentAddress(*ca) : "";
}
Hash getContentAddressHash(const ContentAddress & ca)
{
return std::visit(overloaded {
[](TextHash th) {
return th.hash;
},
[](FixedOutputHash fsh) {
return fsh.hash;
}
}, ca);
}
}