From ff846bc6784f1245bc2b1c83651fea3b673c563a Mon Sep 17 00:00:00 2001 From: AsamK Date: Sat, 12 Jul 2025 10:05:57 +0200 Subject: [PATCH] Fix clippy warnings --- client/src/main.rs | 2 +- client/src/transports/mod.rs | 6 +++--- client/src/transports/stream_codec.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 35c1ab22..68de03d4 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -70,7 +70,7 @@ async fn handle_command( .await .map_err(|e| RpcError::Custom(format!("JSON-RPC command startLink failed: {e:?}")))? .device_link_uri; - println!("{}", url); + println!("{url}"); client.finish_link(url, name).await } CliCommands::ListAccounts => client.list_accounts().await, diff --git a/client/src/transports/mod.rs b/client/src/transports/mod.rs index 3d0c4195..ad552cbf 100644 --- a/client/src/transports/mod.rs +++ b/client/src/transports/mod.rs @@ -27,7 +27,7 @@ impl + Unpin + 'static> T self.inner .send(body) .await - .map_err(|e| Errors::Other(format!("{:?}", e)))?; + .map_err(|e| Errors::Other(format!("{e:?}")))?; Ok(()) } @@ -35,7 +35,7 @@ impl + Unpin + 'static> T self.inner .close() .await - .map_err(|e| Errors::Other(format!("{:?}", e)))?; + .map_err(|e| Errors::Other(format!("{e:?}")))?; Ok(()) } } @@ -53,7 +53,7 @@ impl> + Unpin + 'static> match self.inner.next().await { None => Err(Errors::Closed), Some(Ok(msg)) => Ok(ReceivedMessage::Text(msg)), - Some(Err(e)) => Err(Errors::Other(format!("{:?}", e))), + Some(Err(e)) => Err(Errors::Other(format!("{e:?}"))), } } } diff --git a/client/src/transports/stream_codec.rs b/client/src/transports/stream_codec.rs index 6f77306f..e46233cb 100644 --- a/client/src/transports/stream_codec.rs +++ b/client/src/transports/stream_codec.rs @@ -41,7 +41,7 @@ impl Decoder for StreamCodec { match str::from_utf8(line.as_ref()) { Ok(s) => Ok(Some(s.to_string())), - Err(_) => Err(io::Error::new(io::ErrorKind::Other, "invalid UTF-8")), + Err(_) => Err(io::Error::other("invalid UTF-8")), } } else { Ok(None) -- 2.50.1