From e83830dcfcbd47a9b9651eca539f5c38ef63eb68 Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Mon, 26 Aug 2024 13:51:13 +0200 Subject: [PATCH] use slice instead of array to not have to hardcode the length --- bitcoin/src/pow.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index 8809830e0..5e0782fae 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -1930,7 +1930,7 @@ mod tests { #[test] fn work_log2() { // Compare work log2 to historical Bitcoin Core values found in Core logs. - let tests: [(u128, f64); 5] = [ + let tests: &[(u128, f64)] = &[ // (chainwork, core log2) // height (0x200020002, 33.000022), // 1 (0xa97d67041c5e51596ee7, 79.405055), // 308004 @@ -1939,7 +1939,7 @@ mod tests { (0x2ef447e01d1642c40a184ada, 93.553183), // 738965 ]; - for (chainwork, core_log2) in tests { + for &(chainwork, core_log2) in tests { // Core log2 in the logs is rounded to 6 decimal places. let log2 = (Work::from(chainwork).log2() * 1e6).round() / 1e6; assert_eq!(log2, core_log2)