1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-23 17:31:08 +01:00

Use named field initialization for references

This commit is contained in:
John Ericson 2023-01-06 12:24:20 -05:00
parent 8623143921
commit 6a168254ce
15 changed files with 34 additions and 26 deletions

View file

@ -154,10 +154,16 @@ Hash getContentAddressHash(const ContentAddress & ca)
ContentAddressWithReferences caWithoutRefs(const ContentAddress & ca) {
return std::visit(overloaded {
[&](const TextHash & h) -> ContentAddressWithReferences {
return TextInfo { h, {}};
return TextInfo {
h,
.references = {},
};
},
[&](const FixedOutputHash & h) -> ContentAddressWithReferences {
return FixedOutputInfo { h, {}};
return FixedOutputInfo {
h,
.references = {},
};
},
}, ca);
}