diff options
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/connector.rs | 8 | ||||
| -rw-r--r-- | src/client/connector/httpconnector.rs | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/client/connector.rs b/src/client/connector.rs index ee40089..f9cee1a 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -1,11 +1,15 @@ pub mod httpconnector; -use std::net::IpAddr; +use std::{ + fmt::{Debug, Display}, + net::IpAddr, + result, +}; use crate::{client::Client, executor::Executor}; use remote_control_rs::tasks::NETWORK_T; -pub type Result<T: std::fmt::Display, E: std::fmt::Debug> = std::result::Result<T, E>; +pub type Result<T: Display, E: Debug> = result::Result<T, E>; pub trait Connection { type Ok: std::fmt::Display + AsRef<str> = String; diff --git a/src/client/connector/httpconnector.rs b/src/client/connector/httpconnector.rs index 5cfbe30..dbd094c 100644 --- a/src/client/connector/httpconnector.rs +++ b/src/client/connector/httpconnector.rs @@ -4,7 +4,7 @@ use reqwest::{ Error, StatusCode, Url, blocking::{Client, RequestBuilder}, }; -use std::{net::IpAddr, thread::sleep, time::Duration}; +use std::{net::IpAddr, result, thread::sleep, time::Duration}; #[derive(Debug)] pub enum HTTPConnectorError { @@ -34,7 +34,7 @@ pub struct HTTPConnector { } impl HTTPConnector { - pub fn new(pull_url: &str, ntfy_url: &str, ip_getter_url: &str) -> std::result::Result<Self, HTTPConnectorError> { + pub fn new(pull_url: &str, ntfy_url: &str, ip_getter_url: &str) -> result::Result<Self, HTTPConnectorError> { Ok(Self { network_enforcer: Executor::new(&NETWORK_T, ["true"]).unwrap(), // .unwrap() should never panic prev: String::new(), |
