From 5ffb99786429de1cf830b5aefa251705c5434055 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 22 Nov 2023 22:35:14 +0300 Subject: fix(tvix): ensure PartialOrd/Ord agree for StorePath & NixString This fixes a *future* clippy lint: https://rust-lang.github.io/rust-clippy/master/index.html#/incorrect_partial_ord_impl_on_ord_type In essence, because the implementation of *both* Ord and PartialOrd implies that ordering is not partial, all results of PartialOrd should simply be those of Ord. This is to avoid subtle bugs in future refactorings. Change-Id: I8fc6694010208752dd47746a2aaaeca0c788d574 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10109 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/nix-compat/src/store_path/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tvix/nix-compat/src/store_path/mod.rs') diff --git a/tvix/nix-compat/src/store_path/mod.rs b/tvix/nix-compat/src/store_path/mod.rs index 830f75c36a92..350e65d83fb0 100644 --- a/tvix/nix-compat/src/store_path/mod.rs +++ b/tvix/nix-compat/src/store_path/mod.rs @@ -70,7 +70,7 @@ impl StorePath { impl PartialOrd for StorePath { fn partial_cmp(&self, other: &Self) -> Option { - self.digest.partial_cmp(&other.digest) + Some(self.cmp(other)) } } -- cgit 1.4.1