Mercurial > hg
diff rust/hg-core/src/revlog/node.rs @ 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 | c7fb9b74e753 |
children | 532e74ad3ff6 |
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() } }