diff rust/hg-core/src/revlog/node.rs @ 51696:7f0cb9ee0534

Backout accidental publication of a large range of revisions I accidentally published 25e7f9dcad0f::bd1483fd7088, this is the inverse.
author Rapha?l Gom?s <rgomes@octobus.net>
date Tue, 23 Jul 2024 10:02:46 +0200
parents 918ceb5a3d25
children ec7171748350
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/node.rs	Mon Jul 22 16:49:38 2024 +0200
+++ b/rust/hg-core/src/revlog/node.rs	Tue Jul 23 10:02:46 2024 +0200
@@ -83,7 +83,7 @@
     #[inline]
     fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error> {
         match Node::from_bytes(bytes) {
-            Ok((node, [])) => Ok(node),
+            Ok((node, rest)) if rest.is_empty() => Ok(node),
             _ => Err(()),
         }
     }
@@ -323,9 +323,6 @@
 }
 
 #[cfg(test)]
-pub use tests::hex_pad_right;
-
-#[cfg(test)]
 mod tests {
     use super::*;
 
@@ -431,3 +428,6 @@
         assert_eq!(prefix.first_different_nybble(&node), None);
     }
 }
+
+#[cfg(test)]
+pub use tests::hex_pad_right;