Skip to content

Commit

Permalink
Clippy stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Aug 1, 2023
1 parent f427f0d commit 4337c3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
7 changes: 3 additions & 4 deletions ferveo-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ impl fmt::Display for Error {
Error::InvalidByteLength(expected, actual) => {
write!(
f,
"Invalid byte length: expected {}, actual {}",
expected, actual
"Invalid byte length: expected {expected}, actual {actual}"
)
}
Error::SerializationError(e) => {
write!(f, "Serialization error: {}", e)
write!(f, "Serialization error: {e}")
}
Error::InvalidSeedLength(len) => {
write!(f, "Invalid seed length: {}", len)
write!(f, "Invalid seed length: {len}")
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions ferveo/src/bindings_python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ impl From<FerveoPythonError> for PyErr {
expected,
actual,
) => InsufficientTranscriptsForAggregate::new_err(format!(
"expected: {}, actual: {}",
expected, actual
"expected: {expected}, actual: {actual}"
)),
Error::InvalidDkgPublicKey => InvalidDkgPublicKey::new_err(""),
Error::InsufficientValidators(expected, actual) => {
InsufficientValidators::new_err(format!(
"expected: {}, actual: {}",
expected, actual
"expected: {expected}, actual: {actual}"
))
}
Error::InvalidTranscriptAggregate => {
Expand All @@ -90,8 +88,7 @@ impl From<FerveoPythonError> for PyErr {
}
Error::InvalidByteLength(expected, actual) => {
InvalidByteLength::new_err(format!(
"expected: {}, actual: {}",
expected, actual
"expected: {expected}, actual: {actual}"
))
}
Error::InvalidVariant(variant) => {
Expand Down
4 changes: 2 additions & 2 deletions ferveo/src/bindings_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn set_panic_hook() {
}

pub fn map_js_err<T: fmt::Display>(err: T) -> Error {
Error::new(&format!("{}", err))
Error::new(&format!("{err}"))
}

pub fn to_js_bytes<T: ToBytes>(t: &T) -> Result<Vec<u8>, Error> {
Expand Down Expand Up @@ -577,7 +577,7 @@ pub mod test_common {
}

pub fn gen_address(i: usize) -> EthereumAddress {
EthereumAddress::from_string(&format!("0x{:040}", i)).unwrap()
EthereumAddress::from_string(&format!("0x{i:040}")).unwrap()
}

pub fn gen_validator(i: usize, keypair: &Keypair) -> Validator {
Expand Down

0 comments on commit 4337c3c

Please sign in to comment.