From bad3042d2d454e45eae2dc097caf25dad99c5882 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sat, 20 Jun 2026 21:56:49 -0500 Subject: [PATCH] style: format proxmox client code with cargo fmt --- src-tauri/src/proxmox/client.rs | 38 +++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src-tauri/src/proxmox/client.rs b/src-tauri/src/proxmox/client.rs index ce1e91d2..ad770562 100644 --- a/src-tauri/src/proxmox/client.rs +++ b/src-tauri/src/proxmox/client.rs @@ -349,7 +349,7 @@ mod tests { fn test_auth_response_envelope_deserialization() { // Validates that the `{"data": {...}}` envelope Proxmox uses is parsed // correctly into ProxmoxEnvelope. - // Note: Proxmox returns lowercase fields (ticket, username, clustername) + // Note: Proxmox returns lowercase fields (ticket, username, clustername) // except for CSRFPreventionToken which is PascalCase. let json = r#"{ "data": { @@ -431,7 +431,7 @@ mod tests { return; } }; - + let mut client = ProxmoxClient::new("172.0.0.18", 8006, "root@pam"); let result = client.authenticate(&password).await; match result { @@ -456,9 +456,12 @@ mod tests { return; } }; - + let mut client = ProxmoxClient::new("172.0.0.18", 8006, "root@pam"); - client.authenticate(&password).await.expect("Authentication failed"); + client + .authenticate(&password) + .await + .expect("Authentication failed"); #[derive(serde::Deserialize, Debug)] struct Resource { @@ -470,7 +473,9 @@ mod tests { status: Option, } - let result: Result, _> = client.get("cluster/resources", client.ticket.as_deref()).await; + let result: Result, _> = client + .get("cluster/resources", client.ticket.as_deref()) + .await; match result { Ok(resources) => { println!("✓ Cluster resources fetched successfully"); @@ -496,9 +501,12 @@ mod tests { return; } }; - + let mut client = ProxmoxClient::new("proxmox-server", 8006, "root@pam"); - client.authenticate(&password).await.expect("Authentication failed"); + client + .authenticate(&password) + .await + .expect("Authentication failed"); #[derive(serde::Deserialize, Debug)] struct Node { @@ -535,9 +543,12 @@ mod tests { return; } }; - + let mut client = ProxmoxClient::new("proxmox-server", 8006, "root@pam"); - client.authenticate(&password).await.expect("Authentication failed"); + client + .authenticate(&password) + .await + .expect("Authentication failed"); #[derive(serde::Deserialize, Debug)] struct Resource { @@ -548,10 +559,15 @@ mod tests { status: Option, } - let result: Result, _> = client.get("cluster/resources", client.ticket.as_deref()).await; + let result: Result, _> = client + .get("cluster/resources", client.ticket.as_deref()) + .await; match result { Ok(resources) => { - let vms: Vec<_> = resources.into_iter().filter(|r| r.r#type.as_deref() == Some("qemu")).collect(); + let vms: Vec<_> = resources + .into_iter() + .filter(|r| r.r#type.as_deref() == Some("qemu")) + .collect(); println!("✓ VMs fetched successfully"); println!(" Found {} VMs", vms.len()); }