diff --git a/peach-lib/src/lib.rs b/peach-lib/src/lib.rs index 2c684424..1144fc74 100644 --- a/peach-lib/src/lib.rs +++ b/peach-lib/src/lib.rs @@ -1,7 +1,3 @@ -// this is to ignore a clippy warning that suggests -// to replace code with the same code that is already there (possibly a bug) -#![allow(clippy::nonstandard_macro_braces)] - pub mod config_manager; pub mod dyndns_client; pub mod error; diff --git a/peach-lib/src/network_client.rs b/peach-lib/src/network_client.rs index cf22f2fc..be03aa4b 100644 --- a/peach-lib/src/network_client.rs +++ b/peach-lib/src/network_client.rs @@ -9,9 +9,6 @@ //! Several helper methods are also included here which bundle multiple client //! calls to achieve the desired functionality. -// TODO: fix these clippy errors so this allow can be removed -#![allow(clippy::needless_borrow)] - use std::env; use jsonrpc_client_core::{expand_params, jsonrpc_client}; @@ -166,9 +163,9 @@ pub fn disable(iface: &str, ssid: &str) -> std::result::Result std::result::Result std::result::Result { // retrieve a list of access points with saved credentials let saved_aps = match client.saved_networks().call() { Ok(ssids) => { - let networks: Vec = serde_json::from_str(ssids.as_str()) - .expect("Failed to deserialize saved_networks response"); + let networks: Vec = serde_json::from_str(ssids.as_str())?; networks } // return an empty vector if there are no saved access point credentials @@ -479,7 +475,7 @@ pub fn traffic(iface: &str) -> std::result::Result { let mut client = PeachNetworkClient::new(transport_handle); let response = client.traffic(iface).call()?; - let t: Traffic = serde_json::from_str(&response).unwrap(); + let t: Traffic = serde_json::from_str(&response)?; Ok(t) } @@ -506,13 +502,13 @@ pub fn update(iface: &str, ssid: &str, pass: &str) -> std::result::Result