From 1a07a1bac424d3a572535da8d4d9f100011f2d31 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sat, 6 Jun 2026 12:04:21 -0500 Subject: [PATCH] fix(fmt): format code with cargo fmt --- src-tauri/src/commands/integrations.rs | 4 +++- src-tauri/src/commands/kube.rs | 24 ++++++++---------------- src-tauri/src/kube/client.rs | 7 +------ src-tauri/src/kube/refresh.rs | 2 +- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src-tauri/src/commands/integrations.rs b/src-tauri/src/commands/integrations.rs index c6df443d..bf82d502 100644 --- a/src-tauri/src/commands/integrations.rs +++ b/src-tauri/src/commands/integrations.rs @@ -337,7 +337,9 @@ pub async fn initiate_oauth( pending_approvals, clusters: Arc::new(tokio::sync::Mutex::new(std::collections::HashMap::new())), port_forwards: Arc::new(tokio::sync::Mutex::new(std::collections::HashMap::new())), - refresh_registry: Arc::new(tokio::sync::Mutex::new(crate::kube::RefreshRegistry::new())), + refresh_registry: Arc::new(tokio::sync::Mutex::new( + crate::kube::RefreshRegistry::new(), + )), }; while let Some(callback) = callback_rx.recv().await { tracing::info!("Received OAuth callback for state: {}", callback.state); diff --git a/src-tauri/src/commands/kube.rs b/src-tauri/src/commands/kube.rs index f425dc1b..d556b987 100644 --- a/src-tauri/src/commands/kube.rs +++ b/src-tauri/src/commands/kube.rs @@ -61,12 +61,9 @@ pub async fn add_cluster( } #[tauri::command] -pub async fn remove_cluster( - id: String, - state: State<'_, AppState>, -) -> Result<(), String> { +pub async fn remove_cluster(id: String, state: State<'_, AppState>) -> Result<(), String> { let mut clusters = state.clusters.lock().await; - + if clusters.remove(&id).is_none() { return Err(format!("Cluster {id} not found")); } @@ -75,11 +72,9 @@ pub async fn remove_cluster( } #[tauri::command] -pub async fn list_clusters( - state: State<'_, AppState>, -) -> Result, String> { +pub async fn list_clusters(state: State<'_, AppState>) -> Result, String> { let clusters = state.clusters.lock().await; - + let cluster_list: Vec = clusters .values() .map(|c| ClusterInfo { @@ -99,7 +94,7 @@ pub async fn start_port_forward( state: State<'_, AppState>, ) -> Result { let session_id = uuid::Uuid::now_v7().to_string(); - + let session = crate::kube::PortForwardSession::new( session_id.clone(), request.cluster_id.clone(), @@ -127,12 +122,9 @@ pub async fn start_port_forward( } #[tauri::command] -pub async fn stop_port_forward( - id: String, - state: State<'_, AppState>, -) -> Result<(), String> { +pub async fn stop_port_forward(id: String, state: State<'_, AppState>) -> Result<(), String> { let mut port_forwards = state.port_forwards.lock().await; - + if let Some(session) = port_forwards.get_mut(&id) { session.stop(); Ok(()) @@ -146,7 +138,7 @@ pub async fn list_port_forwards( state: State<'_, AppState>, ) -> Result, String> { let port_forwards = state.port_forwards.lock().await; - + let forwards: Vec = port_forwards .values() .map(|s| PortForwardResponse { diff --git a/src-tauri/src/kube/client.rs b/src-tauri/src/kube/client.rs index 85e19cb4..f33b18c1 100644 --- a/src-tauri/src/kube/client.rs +++ b/src-tauri/src/kube/client.rs @@ -6,12 +6,7 @@ pub struct ClusterClient { } impl ClusterClient { - pub fn new( - id: String, - name: String, - context: String, - server_url: String, - ) -> Self { + pub fn new(id: String, name: String, context: String, server_url: String) -> Self { Self { id, name, diff --git a/src-tauri/src/kube/refresh.rs b/src-tauri/src/kube/refresh.rs index 566f3cba..7e4acb83 100644 --- a/src-tauri/src/kube/refresh.rs +++ b/src-tauri/src/kube/refresh.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use tokio::sync::RwLock; use std::sync::Arc; +use tokio::sync::RwLock; pub struct RefreshRegistry { domains: HashMap,