Skip to content

Commit

Permalink
Remove unneeded return statement
Browse files Browse the repository at this point in the history
Clippy emits:

  warning: unneeded `return` statement

As suggested, remove the unneeded return statement.
  • Loading branch information
tcharding committed May 25, 2022
1 parent 16cac3c commit 4b28a1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/util/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl FromStr for PublicKey {
match s.len() {
66 => PublicKey::from_slice(&<[u8; 33]>::from_hex(s)?),
130 => PublicKey::from_slice(&<[u8; 65]>::from_hex(s)?),
len => return Err(Error::Hex(hex::Error::InvalidLength(66, len)))
len => Err(Error::Hex(hex::Error::InvalidLength(66, len))),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/schnorr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl SchnorrSig {
// default type
let sig = secp256k1::schnorr::Signature::from_slice(sl)
.map_err(SchnorrSigError::Secp256k1)?;
return Ok( SchnorrSig { sig, hash_ty : SchnorrSighashType::Default });
Ok(SchnorrSig { sig, hash_ty: SchnorrSighashType::Default })
},
65 => {
let (hash_ty, sig) = sl.split_last().expect("Slice len checked == 65");
Expand Down

0 comments on commit 4b28a1b

Please sign in to comment.