1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

Merge pull request #3899 from obsidiansystems/make-narHash-not-optional

Make narHash in ValidPathInfo not optional
This commit is contained in:
Eelco Dolstra 2020-08-14 17:00:18 +02:00 committed by GitHub
commit d81f13f7cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 145 additions and 118 deletions

View file

@ -136,6 +136,8 @@ std::string Hash::to_string(Base base, bool includeType) const
return s;
}
Hash Hash::dummy(htSHA256);
Hash Hash::parseSRI(std::string_view original) {
auto rest = original;

View file

@ -59,9 +59,6 @@ private:
Hash(std::string_view s, HashType type, bool isSRI);
public:
/* Check whether a hash is set. */
operator bool () const { return (bool) type; }
/* Check whether two hash are equal. */
bool operator == (const Hash & h2) const;
@ -105,6 +102,8 @@ public:
assert(type == htSHA1);
return std::string(to_string(Base16, false), 0, 7);
}
static Hash dummy;
};
/* Helper that defaults empty hashes to the 0 hash. */