Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/revlog/node.rs @ 51752:918ceb5a3d25
rust: apply clippy lints
They are at most harmless and at best make the codebase more readable and
simpler.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 18 Jul 2024 13:35:39 +0200 |
parents | b4d152a28742 |
children | 7f0cb9ee0534 |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/node.rs Thu Jul 18 12:38:26 2024 +0200 +++ b/rust/hg-core/src/revlog/node.rs Thu Jul 18 13:35:39 2024 +0200 @@ -83,7 +83,7 @@ #[inline] fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error> { match Node::from_bytes(bytes) { - Ok((node, rest)) if rest.is_empty() => Ok(node), + Ok((node, [])) => Ok(node), _ => Err(()), } } @@ -323,6 +323,9 @@ } #[cfg(test)] +pub use tests::hex_pad_right; + +#[cfg(test)] mod tests { use super::*; @@ -428,6 +431,3 @@ assert_eq!(prefix.first_different_nybble(&node), None); } } - -#[cfg(test)] -pub use tests::hex_pad_right;