about summary refs log tree commit diff
path: root/tvix/nix-compat/src/nix_daemon
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-10-15T23·51+0300
committerflokli <flokli@flokli.de>2024-11-12T11·55+0000
commit1428ea4e191aa897a0a23e2c90f997f0b65aae6d (patch)
tree6a093f91b2deff805bf08715edced90d490716d4 /tvix/nix-compat/src/nix_daemon
parent14744713276870cf0380e31bee01124e1a2f4cb0 (diff)
refactor(nix-compat/store_path): use AsRef<str> r/8913
Implement PartialEq/Eq ourselves instead of deriving, by proxying to
name.as_ref() (and digest of course).

Also implement Hash on our own, clippy doesn't like this to be derived,
while Eq/PartialEq is not.

Change-Id: Idbe289a23ba3bc8dabf893d4d8752792ae2778c3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12744
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/nix-compat/src/nix_daemon')
-rw-r--r--tvix/nix-compat/src/nix_daemon/types.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/tvix/nix-compat/src/nix_daemon/types.rs b/tvix/nix-compat/src/nix_daemon/types.rs
index 3f2490c62657..33b74f37574f 100644
--- a/tvix/nix-compat/src/nix_daemon/types.rs
+++ b/tvix/nix-compat/src/nix_daemon/types.rs
@@ -1,5 +1,3 @@
-use std::{fmt::Display, ops::Deref};
-
 use nix_compat_derive::{NixDeserialize, NixSerialize};
 
 use crate::{
@@ -130,7 +128,7 @@ impl NixDeserialize for StorePath<String> {
 // Custom implementation since Display does not use absolute paths.
 impl<S> NixSerialize for StorePath<S>
 where
-    S: std::cmp::Eq + Deref<Target = str> + Display + Sync,
+    S: AsRef<str> + Sync,
 {
     async fn serialize<W>(&self, writer: &mut W) -> Result<(), W::Error>
     where