about summary refs log tree commit diff
path: root/third_party/nix/src/libutil/hash.hh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libutil/hash.hh')
-rw-r--r--third_party/nix/src/libutil/hash.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/third_party/nix/src/libutil/hash.hh b/third_party/nix/src/libutil/hash.hh
index 208615f67bc8..4ad4ef6ada02 100644
--- a/third_party/nix/src/libutil/hash.hh
+++ b/third_party/nix/src/libutil/hash.hh
@@ -36,12 +36,15 @@ struct Hash {
      Subresource Integrity hash expression). If the 'type' argument
      is htUnknown, then the hash type must be specified in the
      string. */
-  Hash(const std::string& s, HashType type = htUnknown);
+  Hash(std::string_view s, HashType type = htUnknown);
 
   /* Status-returning version of above constructor */
-  static absl::StatusOr<Hash> deserialize(const std::string& s,
+  static absl::StatusOr<Hash> deserialize(std::string_view s,
                                           HashType type = htUnknown);
 
+  // Legacy unwrapper for StatusOr. Throws BadHash.
+  static Hash unwrap_throw(absl::StatusOr<Hash> hash) noexcept(false);
+
   void init();
 
   /* Check whether a hash is set. */