From ba808044be8f3123736d10f14478a07fe020c9b7 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 19 Sep 2025 17:47:46 +0800 Subject: chore: more concise qualification --- src/client/connector.rs | 8 ++++++-- src/client/connector/httpconnector.rs | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/client') 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 = std::result::Result; +pub type Result = result::Result; pub trait Connection { type Ok: std::fmt::Display + AsRef = 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 { + pub fn new(pull_url: &str, ntfy_url: &str, ip_getter_url: &str) -> result::Result { Ok(Self { network_enforcer: Executor::new(&NETWORK_T, ["true"]).unwrap(), // .unwrap() should never panic prev: String::new(), -- cgit v1.2.3