diff --git a/src/sbot.rs b/src/sbot.rs index 2e4a1bb..e553d70 100644 --- a/src/sbot.rs +++ b/src/sbot.rs @@ -1,6 +1,5 @@ //! Sbot type and connection-related methods. use async_std::net::TcpStream; -use log::debug; use kuska_handshake::async_std::BoxStream; use kuska_sodiumoxide::crypto::{auth, sign::ed25519}; @@ -65,7 +64,7 @@ impl Sbot { ip_port.unwrap() }; - if address.starts_with(":") { + if address.starts_with(':') { address = format!("127.0.0.1{}", address); } @@ -85,7 +84,7 @@ impl Sbot { Keystore::CustomGoSbot(key_path) => { keystore::from_custom_gosbot_keypath(key_path.to_string()) .await - .expect(&format!( + .unwrap_or_else(|_| panic!( "couldn't read local go-sbot secret from: {}", key_path )) @@ -93,7 +92,7 @@ impl Sbot { Keystore::CustomPatchwork(key_path) => { keystore::from_custom_patchwork_keypath(key_path.to_string()) .await - .expect(&format!( + .unwrap_or_else(|_| panic!( "couldn't read local patchwork secret from: {}", key_path )) diff --git a/src/utils.rs b/src/utils.rs index 5871549..df3fe51 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -76,7 +76,7 @@ where if id == req_no { match msg { RecvMsg::RpcResponse(_type, body) => { - return f(&body).map_err(|err| err); + return f(&body); } RecvMsg::ErrorResponse(message) => { return Err(GolgiError::Sbot(message));