From f714ed6d52d25c7f4a82216c94c4042a22b4a7ba Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Thu, 2 Feb 2023 21:02:55 -0300 Subject: [PATCH] chore: Fix lint issues --- examples/block-decode/src/main.rs | 2 +- pallas-crypto/src/hash/hash.rs | 2 +- pallas-crypto/src/hash/serde.rs | 2 +- pallas-miniprotocols/src/machines.rs | 2 +- pallas-traverse/src/lib.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/block-decode/src/main.rs b/examples/block-decode/src/main.rs index 7f846640..c6e9c11a 100644 --- a/examples/block-decode/src/main.rs +++ b/examples/block-decode/src/main.rs @@ -17,7 +17,7 @@ fn main() { println!("{} {}", block.slot(), block.hash()); for tx in &block.txs() { - println!("{:?}", tx); + println!("{tx:?}"); } } } diff --git a/pallas-crypto/src/hash/hash.rs b/pallas-crypto/src/hash/hash.rs index cee57099..afb3507d 100644 --- a/pallas-crypto/src/hash/hash.rs +++ b/pallas-crypto/src/hash/hash.rs @@ -46,7 +46,7 @@ impl PartialEq<[u8]> for Hash { impl fmt::Debug for Hash { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple(&format!("Hash<{size}>", size = BYTES)) + f.debug_tuple(&format!("Hash<{BYTES}>")) .field(&hex::encode(self)) .finish() } diff --git a/pallas-crypto/src/hash/serde.rs b/pallas-crypto/src/hash/serde.rs index 476b75ca..f8acad6f 100644 --- a/pallas-crypto/src/hash/serde.rs +++ b/pallas-crypto/src/hash/serde.rs @@ -21,7 +21,7 @@ impl<'de, const BYTES: usize> Visitor<'de> for HashVisitor { type Value = Hash; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "a hex string representing {} bytes", BYTES) + write!(formatter, "a hex string representing {BYTES} bytes") } fn visit_str(self, s: &str) -> Result diff --git a/pallas-miniprotocols/src/machines.rs b/pallas-miniprotocols/src/machines.rs index 6d7f261a..18c6976f 100644 --- a/pallas-miniprotocols/src/machines.rs +++ b/pallas-miniprotocols/src/machines.rs @@ -26,7 +26,7 @@ impl MachineError { } pub fn invalid_msg(state: &A::State, msg: &A::Message) -> Self { - Self::InvalidMsgForState(format!("{:?}", state), format!("{:?}", msg)) + Self::InvalidMsgForState(format!("{state:?}"), format!("{msg:?}")) } } diff --git a/pallas-traverse/src/lib.rs b/pallas-traverse/src/lib.rs index d20fc3ae..b3c24e2c 100644 --- a/pallas-traverse/src/lib.rs +++ b/pallas-traverse/src/lib.rs @@ -159,7 +159,7 @@ pub enum Error { impl Error { pub fn invalid_cbor(error: impl Display) -> Self { - Error::InvalidCbor(format!("{}", error)) + Error::InvalidCbor(format!("{error}")) } pub fn unknown_cbor(bytes: &[u8]) -> Self {