From 458712212d4a2340bf3fcfc419c0636e8c2770fc Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 14 Nov 2023 15:54:16 +1100 Subject: [PATCH] Improve code comments "what" comments add no value. Remove one and make the other describe "why" the cast is ok. --- src/ecdsa/serialized_signature.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ecdsa/serialized_signature.rs b/src/ecdsa/serialized_signature.rs index 8cf2c0294..fceaa73b5 100644 --- a/src/ecdsa/serialized_signature.rs +++ b/src/ecdsa/serialized_signature.rs @@ -272,10 +272,8 @@ mod tests { #[test] fn iterator_ops_are_homomorphic() { let mut fake_signature_data = [0; MAX_LEN]; - // fill it with numbers 0 - 71 for (i, byte) in fake_signature_data.iter_mut().enumerate() { - // up to MAX_LEN - *byte = i as u8; + *byte = i as u8; // cast ok because MAX_LEN fits in u8. } let fake_signature = SerializedSignature { data: fake_signature_data, len: MAX_LEN };