From 31f9ee58d0c91d02d96d29ea6e09bf0e4f9c5b92 Mon Sep 17 00:00:00 2001 From: Kane York Date: Mon, 27 Jul 2020 16:50:56 -0700 Subject: fix(3p/nix/hash): provide a Status-returning constructor Additionally, add IsValidBase16() to restore the behavior of rejecting invalid base16, which absl's HexStringToBytes does not do. Change-Id: I777a36f5dc787aa54a2aa316d6728f68da129768 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1484 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nix/src/libutil/types.hh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'third_party/nix/src/libutil/types.hh') diff --git a/third_party/nix/src/libutil/types.hh b/third_party/nix/src/libutil/types.hh index e2ea86fdcf..3d37e4efee 100644 --- a/third_party/nix/src/libutil/types.hh +++ b/third_party/nix/src/libutil/types.hh @@ -44,6 +44,8 @@ struct FormatOrString { inline std::string fmt(const std::string& s) { return s; } +inline std::string fmt(std::string_view s) { return std::string(s); } + inline std::string fmt(const char* s) { return s; } inline std::string fmt(const FormatOrString& fs) { return fs.s; } -- cgit 1.4.1