Replace assert!(false) with panic!

Clippy emits:

  warning: `assert!(false)` should probably be replaced

As suggested, replace assert with a call to panic.
This commit is contained in:
Tobin C. Harding 2022-06-07 15:03:25 +10:00
parent a8039e1742
commit 922b820105
1 changed files with 2 additions and 2 deletions

View File

@ -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"),
}
}