]> nmode's Git Repositories - signal-cli/commitdiff
Fix clippy warnings
authorAsamK <asamk@gmx.de>
Sat, 12 Jul 2025 08:05:57 +0000 (10:05 +0200)
committerAsamK <asamk@gmx.de>
Sat, 12 Jul 2025 08:05:57 +0000 (10:05 +0200)
client/src/main.rs
client/src/transports/mod.rs
client/src/transports/stream_codec.rs

index 35c1ab229d64c7396e8bb761069cba70468d0fcc..68de03d44cab39409857db7d7d8fec44f5ea489c 100644 (file)
@@ -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,
index 3d0c4195457f0293a472b44dd49173874e755557..ad552cbf12e3b00e71421fd105766b283fd5b3b3 100644 (file)
@@ -27,7 +27,7 @@ impl<T: Send + Sink<String, Error = impl std::error::Error> + 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<T: Send + Sink<String, Error = impl std::error::Error> + 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<T: Send + Stream<Item = Result<String, std::io::Error>> + 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:?}"))),
         }
     }
 }
index 6f77306f689901c806a91073cc8af3b5cc746174..e46233cb93860417fba3fe69c2cbc1721c7ee850 100644 (file)
@@ -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)