Mercurial > hg
comparison rust/hg-core/src/revlog/node.rs @ 51120:532e74ad3ff6
rust: run a clippy pass with the latest stable version
Our current version of clippy is older than the latest stable.
The newest version has new lints that are moslty good advice, so let's apply
them ahead of time. This has the added benefit of reducing the noise for
developpers like myself that use clippy as an IDE helper, as well as being
more prepared for a future clippy upgrade.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 06 Nov 2023 11:06:08 +0100 |
parents | 2202832b35e8 |
children | b4d152a28742 |
comparison
equal
deleted
inserted
replaced
51119:d58e754f2db0 | 51120:532e74ad3ff6 |
---|---|
346 let too_short = "0123"; | 346 let too_short = "0123"; |
347 let too_long = format!("{}0", SAMPLE_NODE_HEX); | 347 let too_long = format!("{}0", SAMPLE_NODE_HEX); |
348 assert_eq!(Node::from_hex(SAMPLE_NODE_HEX).unwrap(), SAMPLE_NODE); | 348 assert_eq!(Node::from_hex(SAMPLE_NODE_HEX).unwrap(), SAMPLE_NODE); |
349 assert!(Node::from_hex(not_hex).is_err()); | 349 assert!(Node::from_hex(not_hex).is_err()); |
350 assert!(Node::from_hex(too_short).is_err()); | 350 assert!(Node::from_hex(too_short).is_err()); |
351 assert!(Node::from_hex(&too_long).is_err()); | 351 assert!(Node::from_hex(too_long).is_err()); |
352 } | 352 } |
353 | 353 |
354 #[test] | 354 #[test] |
355 fn test_node_encode_hex() { | 355 fn test_node_encode_hex() { |
356 assert_eq!(format!("{:x}", SAMPLE_NODE), SAMPLE_NODE_HEX); | 356 assert_eq!(format!("{:x}", SAMPLE_NODE), SAMPLE_NODE_HEX); |