chore: Fix lint issues (#222)

This commit is contained in:
Santiago Carmuega 2023-02-03 01:07:14 +01:00 committed by GitHub
parent fe5e2d038d
commit 9d8ca617ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -17,7 +17,7 @@ fn main() {
println!("{} {}", block.slot(), block.hash());
for tx in &block.txs() {
println!("{:?}", tx);
println!("{tx:?}");
}
}
}

View file

@ -46,7 +46,7 @@ impl<const BYTES: usize> PartialEq<[u8]> for Hash<BYTES> {
impl<const BYTES: usize> fmt::Debug for Hash<BYTES> {
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()
}

View file

@ -21,7 +21,7 @@ impl<'de, const BYTES: usize> Visitor<'de> for HashVisitor<BYTES> {
type Value = Hash<BYTES>;
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<E>(self, s: &str) -> Result<Self::Value, E>

View file

@ -26,7 +26,7 @@ impl MachineError {
}
pub fn invalid_msg<A: Agent>(state: &A::State, msg: &A::Message) -> Self {
Self::InvalidMsgForState(format!("{:?}", state), format!("{:?}", msg))
Self::InvalidMsgForState(format!("{state:?}"), format!("{msg:?}"))
}
}

View file

@ -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 {