From 922b82010568f61e5f2556f05b1f4769cab777b5 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jun 2022 15:03:25 +1000 Subject: [PATCH] Replace assert!(false) with panic! Clippy emits: warning: `assert!(false)` should probably be replaced As suggested, replace assert with a call to panic. --- src/blockdata/block.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blockdata/block.rs b/src/blockdata/block.rs index d69c97b9..24ba4bc7 100644 --- a/src/blockdata/block.rs +++ b/src/blockdata/block.rs @@ -517,7 +517,7 @@ mod tests { // test with zero target match some_header.validate_pow(&Uint256::default()) { Err(BlockBadTarget) => (), - _ => assert!(false) + _ => panic!("unexpected result from validate_pow"), } // test with modified header @@ -525,7 +525,7 @@ mod tests { invalid_header.version = invalid_header.version + 1; match invalid_header.validate_pow(&invalid_header.target()) { Err(BlockBadProofOfWork) => (), - _ => assert!(false) + _ => panic!("unexpected result from validate_pow"), } }