From c02e74bea833224e2ff35c6da51ff30119d7b924 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 14 Sep 2025 22:07:59 +0800 Subject: chore(httpconnector): better naming and qualification --- src/client/connector/connectors/httpconnector.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client/connector/connectors/httpconnector.rs b/src/client/connector/connectors/httpconnector.rs index f3d9ef9..8f06074 100644 --- a/src/client/connector/connectors/httpconnector.rs +++ b/src/client/connector/connectors/httpconnector.rs @@ -1,14 +1,13 @@ +use crate::{connector::Connection, executor::Executor}; +use remote_control_rs::tasks::TASKS; use reqwest::{ Error, StatusCode, Url, blocking::{Client, RequestBuilder}, }; - -use crate::connector::*; -use remote_control_rs::tasks::TASKS; -use std::{thread::sleep, time::Duration}; +use std::{net::IpAddr, thread::sleep, time::Duration}; pub struct HTTPConnector { - network_updater: Executor, + network_enforcer: Executor, pull_url: Url, ntfy_url: Url, ip_getter_url: Url, @@ -25,7 +24,7 @@ impl HTTPConnector { // TODO: proper type assert_eq!(TASKS[2].name, "network"); Ok(Self { - network_updater: Executor::new(&TASKS[2], ["on".to_string()]).unwrap(), + network_enforcer: Executor::new(&TASKS[2], ["on".to_string()]).unwrap(), // .unwrap() should never panic prev: String::new(), pull_url: Url::parse(pull_url)?, ntfy_url: Url::parse(ntfy_url)?, @@ -103,7 +102,7 @@ impl Connection for HTTPConnector { } fn force_network(&mut self) { - _ = self.network_updater.run(); + _ = self.network_enforcer.run(); } fn get_ip(&self) -> Option { -- cgit v1.2.3