aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/downstream-placeholder.cc
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-08-01 13:42:02 -0700
committerJade Lovelace <lix@jade.fyi>2024-08-08 14:53:17 -0700
commit370ac940dd7816ad4052fafa4e0f8d17784fa16b (patch)
tree8b44ebb7e8f4e218c1b4e57edfc6aaac212b90fa /src/libstore/downstream-placeholder.cc
parentf3ef0899c744ff5256414c8539c75e798a058ee0 (diff)
refactor: make HashType and Base enum classes for type safety
Change-Id: I9fbd55a9d50464a56fe11cb42a06a206914150d8
Diffstat (limited to 'src/libstore/downstream-placeholder.cc')
-rw-r--r--src/libstore/downstream-placeholder.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/downstream-placeholder.cc b/src/libstore/downstream-placeholder.cc
index 7e3f7548d..d6af5c951 100644
--- a/src/libstore/downstream-placeholder.cc
+++ b/src/libstore/downstream-placeholder.cc
@@ -5,7 +5,7 @@ namespace nix {
std::string DownstreamPlaceholder::render() const
{
- return "/" + hash.to_string(Base32, false);
+ return "/" + hash.to_string(Base::Base32, false);
}
@@ -19,7 +19,7 @@ DownstreamPlaceholder DownstreamPlaceholder::unknownCaOutput(
auto drvName = drvNameWithExtension.substr(0, drvNameWithExtension.size() - 4);
auto clearText = "nix-upstream-output:" + std::string { drvPath.hashPart() } + ":" + outputPathName(drvName, outputName);
return DownstreamPlaceholder {
- hashString(htSHA256, clearText)
+ hashString(HashType::SHA256, clearText)
};
}
@@ -31,10 +31,10 @@ DownstreamPlaceholder DownstreamPlaceholder::unknownDerivation(
xpSettings.require(Xp::DynamicDerivations);
auto compressed = compressHash(placeholder.hash, 20);
auto clearText = "nix-computed-output:"
- + compressed.to_string(Base32, false)
+ + compressed.to_string(Base::Base32, false)
+ ":" + std::string { outputName };
return DownstreamPlaceholder {
- hashString(htSHA256, clearText)
+ hashString(HashType::SHA256, clearText)
};
}