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 <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Ilan Joselevich 2024-03-27 00:25:28 +02:00
parent 21481b02b8
commit ac88c52be3

View file

@ -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,