changeset 49927:2202832b35e8

rust-nodemap: implement `PartialEq` without allocation This was caught by `clippy`. It's probable that this ends up optimized out by the compiler, but let's not rely on that.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 09 Jan 2023 18:58:18 +0100
parents 0780371d6b1e
children ccb6cfb0f2c0
files rust/hg-core/src/revlog/node.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/node.rs	Mon Jan 09 18:54:57 2023 +0100
+++ b/rust/hg-core/src/revlog/node.rs	Mon Jan 09 18:58:18 2023 +0100
@@ -314,7 +314,7 @@
 
 impl PartialEq<Node> for NodePrefix {
     fn eq(&self, other: &Node) -> bool {
-        Self::from(*other) == *self
+        self.data == other.data && self.nybbles_len() == other.nybbles_len()
     }
 }