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:
commit
c466cb2091
7 changed files with 69 additions and 21 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue