diff --git a/rust/hg-core/src/revlog/node.rs b/rust/hg-core/src/revlog/node.rs --- a/rust/hg-core/src/revlog/node.rs +++ b/rust/hg-core/src/revlog/node.rs @@ -160,7 +160,7 @@ impl NodePrefix { pub fn from_hex(hex: impl AsRef<[u8]>) -> Result { let hex = hex.as_ref(); let len = hex.len(); - if len > NODE_NYBBLES_LENGTH { + if len > NODE_NYBBLES_LENGTH || len == 0 { return Err(FromHexError); } @@ -201,10 +201,6 @@ impl<'a> NodePrefixRef<'a> { } } - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - pub fn is_prefix_of(&self, node: &Node) -> bool { if self.is_odd { let buf = self.buf;