##// END OF EJS Templates
rust: Exclude empty node prefixes...
Simon Sapin -
r47157:e61c2dc6 default
parent child Browse files
Show More
@@ -160,7 +160,7 b' impl NodePrefix {'
160 160 pub fn from_hex(hex: impl AsRef<[u8]>) -> Result<Self, FromHexError> {
161 161 let hex = hex.as_ref();
162 162 let len = hex.len();
163 if len > NODE_NYBBLES_LENGTH {
163 if len > NODE_NYBBLES_LENGTH || len == 0 {
164 164 return Err(FromHexError);
165 165 }
166 166
@@ -201,10 +201,6 b" impl<'a> NodePrefixRef<'a> {"
201 201 }
202 202 }
203 203
204 pub fn is_empty(&self) -> bool {
205 self.len() == 0
206 }
207
208 204 pub fn is_prefix_of(&self, node: &Node) -> bool {
209 205 if self.is_odd {
210 206 let buf = self.buf;
General Comments 0
You need to be logged in to leave comments. Login now