Rust 1.67 cargo clippy fix (#56)

* Run clippy --fix for updated lint requirements

* Fmt after clippy
This commit is contained in:
gusto 2023-01-27 11:04:42 +02:00 committed by GitHub
parent e007539531
commit 8e2346c29e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 22 deletions

View File

@ -113,7 +113,7 @@ mod tests {
fn ser_de() {
let tmp = String::from("much wow, very cool");
let mut buf = Vec::new();
let _ = serializer(&mut buf).serialize_into(&tmp).unwrap();
serializer(&mut buf).serialize_into(&tmp).unwrap();
let deserialized = deserializer(&buf).deserialize::<String>().unwrap();
assert_eq!(tmp, deserialized);
}
@ -122,7 +122,7 @@ mod tests {
fn ser_de_slice() {
let tmp = String::from("much wow, very cool");
let mut buf = vec![0; 1024];
let _ = serializer_into_buffer(&mut buf)
serializer_into_buffer(&mut buf)
.serialize_into(&tmp)
.unwrap();
let deserialized = deserializer(&buf).deserialize::<String>().unwrap();

View File

@ -94,7 +94,7 @@ where
.unwrap();
let value = receiver.await.unwrap();
res_tx
.send(format!("Hello, world! {}", value).into())
.send(format!("Hello, world! {value}").into())
.await
.unwrap();
}

View File

@ -108,8 +108,7 @@ impl Debug for HttpMsg {
req_stream: _,
} => write!(
fmt,
"HttpMsg::AddHandler {{ sender: {:?}, route: {:?} }}",
service_id, route
"HttpMsg::AddHandler {{ sender: {service_id:?}, route: {route:?} }}"
),
}
}

View File

@ -118,7 +118,7 @@ mod serde_level {
{
<String>::deserialize(deserializer).and_then(|v| {
v.parse()
.map_err(|e| D::Error::custom(format!("invalid log level {}", e)))
.map_err(|e| D::Error::custom(format!("invalid log level {e}")))
})
}

View File

@ -61,19 +61,14 @@ impl<Tx: Debug, Id: Debug> Debug for MempoolMsg<Tx, Id> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
match self {
Self::View { ancestor_hint, .. } => {
write!(
f,
"MempoolMsg::View {{ ancestor_hint: {:?}}}",
ancestor_hint
)
write!(f, "MempoolMsg::View {{ ancestor_hint: {ancestor_hint:?}}}")
}
Self::AddTx { tx } => write!(f, "MempoolMsg::AddTx{{tx: {:?}}}", tx),
Self::Prune { ids } => write!(f, "MempoolMsg::Prune{{ids: {:?}}}", ids),
Self::AddTx { tx } => write!(f, "MempoolMsg::AddTx{{tx: {tx:?}}}"),
Self::Prune { ids } => write!(f, "MempoolMsg::Prune{{ids: {ids:?}}}"),
Self::MarkInBlock { ids, block } => {
write!(
f,
"MempoolMsg::MarkInBlock{{ids: {:?}, block: {:?}}}",
ids, block
"MempoolMsg::MarkInBlock{{ids: {ids:?}, block: {block:?}}}"
)
}
Self::Metrics { .. } => write!(f, "MempoolMsg::Metrics"),

View File

@ -45,10 +45,7 @@ where
{
// We panic, but as we could try to reconnect later it should not be
// a problem. But definitely something to consider.
panic!(
"Couldn't send subscribe message to the network service: {}",
e
);
panic!("Couldn't send subscribe message to the network service: {e}");
};
Self {
network_relay,

View File

@ -27,11 +27,10 @@ pub enum NetworkMsg<B: NetworkBackend> {
impl<B: NetworkBackend> Debug for NetworkMsg<B> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Process(msg) => write!(fmt, "NetworkMsg::Process({:?})", msg),
Self::Process(msg) => write!(fmt, "NetworkMsg::Process({msg:?})"),
Self::Subscribe { kind, sender } => write!(
fmt,
"NetworkMsg::Subscribe{{ kind: {:?}, sender: {:?}}}",
kind, sender
"NetworkMsg::Subscribe{{ kind: {kind:?}, sender: {sender:?}}}"
),
}
}