From 412ad3d8bfed70ebf6989f6ed07b70c5b64e9341 Mon Sep 17 00:00:00 2001 From: Andrej Date: Sun, 3 Aug 2025 16:29:59 -0400 Subject: [PATCH] cargo fmt run --- installer/src/main.rs | 2 +- installer/src/uz801.rs | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/installer/src/main.rs b/installer/src/main.rs index 2b418cc..30a343a 100644 --- a/installer/src/main.rs +++ b/installer/src/main.rs @@ -124,7 +124,7 @@ struct TmobileArgs { struct Uz801Args { /// IP address for Uz801 admin interface, if custom. #[arg(long, default_value = "192.168.100.1")] - admin_ip: String + admin_ip: String, } #[derive(Parser, Debug)] diff --git a/installer/src/uz801.rs b/installer/src/uz801.rs index 58888fc..449b14d 100644 --- a/installer/src/uz801.rs +++ b/installer/src/uz801.rs @@ -15,11 +15,7 @@ use tokio::time::sleep; use crate::Uz801Args as Args; use crate::util::echo; -pub async fn install( - Args { - admin_ip, - }: Args, -) -> Result<()> { +pub async fn install(Args { admin_ip }: Args) -> Result<()> { run_install(admin_ip).await } @@ -56,19 +52,22 @@ pub async fn activate_usb_debug(admin_ip: &str) -> Result<()> { let url = format!("http://{}/ajax", admin_ip); let referer = format!("http://{}/usbdebug.html", admin_ip); let origin = format!("http://{}", admin_ip); - + let _handle = tokio::spawn(async move { let client = reqwest::Client::builder() .timeout(Duration::from_secs(5)) .build() .unwrap(); - + let _response = client .post(&url) .header("Accept", "application/json, text/javascript, */*; q=0.01") .header("Accept-Encoding", "gzip, deflate") .header("Referer", &referer) - .header("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8") + .header( + "Content-Type", + "application/x-www-form-urlencoded; charset=UTF-8", + ) .header("X-Requested-With", "XMLHttpRequest") .header("Origin", &origin) .header("Connection", "keep-alive")