cargo fmt run

This commit is contained in:
Andrej
2025-08-03 16:29:59 -04:00
parent 4d2d49326a
commit 412ad3d8bf
2 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ struct TmobileArgs {
struct Uz801Args { struct Uz801Args {
/// IP address for Uz801 admin interface, if custom. /// IP address for Uz801 admin interface, if custom.
#[arg(long, default_value = "192.168.100.1")] #[arg(long, default_value = "192.168.100.1")]
admin_ip: String admin_ip: String,
} }
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
+7 -8
View File
@@ -15,11 +15,7 @@ use tokio::time::sleep;
use crate::Uz801Args as Args; use crate::Uz801Args as Args;
use crate::util::echo; use crate::util::echo;
pub async fn install( pub async fn install(Args { admin_ip }: Args) -> Result<()> {
Args {
admin_ip,
}: Args,
) -> Result<()> {
run_install(admin_ip).await 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 url = format!("http://{}/ajax", admin_ip);
let referer = format!("http://{}/usbdebug.html", admin_ip); let referer = format!("http://{}/usbdebug.html", admin_ip);
let origin = format!("http://{}", admin_ip); let origin = format!("http://{}", admin_ip);
let _handle = tokio::spawn(async move { let _handle = tokio::spawn(async move {
let client = reqwest::Client::builder() let client = reqwest::Client::builder()
.timeout(Duration::from_secs(5)) .timeout(Duration::from_secs(5))
.build() .build()
.unwrap(); .unwrap();
let _response = client let _response = client
.post(&url) .post(&url)
.header("Accept", "application/json, text/javascript, */*; q=0.01") .header("Accept", "application/json, text/javascript, */*; q=0.01")
.header("Accept-Encoding", "gzip, deflate") .header("Accept-Encoding", "gzip, deflate")
.header("Referer", &referer) .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("X-Requested-With", "XMLHttpRequest")
.header("Origin", &origin) .header("Origin", &origin)
.header("Connection", "keep-alive") .header("Connection", "keep-alive")