From ac88c52be301c0173f595a06a5685b26451c8573 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Wed, 27 Mar 2024 00:25:28 +0200 Subject: feat(tvix/nix-compat/store_path): derive Hash for StorePathRef This allows StorePathRef as keys in a hashmap, by deriving Hash. The same is already done for StorePath. Change-Id: I3fc54c45787948116dcb27dfb5dc806b9b505835 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11269 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/nix-compat/src/store_path/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tvix/nix-compat/src/store_path/mod.rs b/tvix/nix-compat/src/store_path/mod.rs index 3638ce6e87..71b7bdcc74 100644 --- a/tvix/nix-compat/src/store_path/mod.rs +++ b/tvix/nix-compat/src/store_path/mod.rs @@ -183,7 +183,7 @@ impl Serialize for StorePath { /// Like [StorePath], but without a heap allocation for the name. /// Used by [StorePath] for parsing. /// -#[derive(Debug, Eq, PartialEq, Clone, Copy)] +#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)] pub struct StorePathRef<'a> { digest: [u8; DIGEST_SIZE], name: &'a str, -- cgit 1.4.1