Skip to content

Commit 9f0f270

Browse files
Tyler Grayclaude
andcommitted
Style: Apply cargo fmt formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e20f0d3 commit 9f0f270

17 files changed

Lines changed: 574 additions & 261 deletions

File tree

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/src/commands/mcp.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ pub fn get_mcp(db: State<'_, Arc<Mutex<Database>>>, id: i64) -> Result<Mcp, Stri
7878
}
7979

8080
#[tauri::command]
81-
pub fn create_mcp(db: State<'_, Arc<Mutex<Database>>>, mcp: CreateMcpRequest) -> Result<Mcp, String> {
81+
pub fn create_mcp(
82+
db: State<'_, Arc<Mutex<Database>>>,
83+
mcp: CreateMcpRequest,
84+
) -> Result<Mcp, String> {
8285
info!("[MCP] Creating new MCP: {}", mcp.name);
8386
let db_guard = db.lock().map_err(|e| {
8487
error!("[MCP] Failed to acquire database lock: {}", e);

src-tauri/src/commands/mcp_gateway.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,15 @@ pub fn get_gateway_connection_config(
120120

121121
/// Get all MCPs configured for the gateway
122122
#[tauri::command]
123-
pub fn get_gateway_mcps(
124-
db: State<'_, Arc<Mutex<Database>>>,
125-
) -> Result<Vec<GatewayMcp>, String> {
123+
pub fn get_gateway_mcps(db: State<'_, Arc<Mutex<Database>>>) -> Result<Vec<GatewayMcp>, String> {
126124
info!("[GatewayCmd] Getting gateway MCPs");
127125
let db = db.lock().map_err(|e| e.to_string())?;
128126
db.get_gateway_mcps().map_err(|e| e.to_string())
129127
}
130128

131129
/// Add an MCP to the gateway
132130
#[tauri::command]
133-
pub fn add_mcp_to_gateway(
134-
db: State<'_, Arc<Mutex<Database>>>,
135-
mcp_id: i64,
136-
) -> Result<(), String> {
131+
pub fn add_mcp_to_gateway(db: State<'_, Arc<Mutex<Database>>>, mcp_id: i64) -> Result<(), String> {
137132
info!("[GatewayCmd] Adding MCP {} to gateway", mcp_id);
138133
let db = db.lock().map_err(|e| e.to_string())?;
139134
db.add_gateway_mcp(mcp_id).map_err(|e| e.to_string())
@@ -157,9 +152,13 @@ pub fn toggle_gateway_mcp(
157152
mcp_id: i64,
158153
enabled: bool,
159154
) -> Result<(), String> {
160-
info!("[GatewayCmd] Toggling gateway MCP {} to {}", mcp_id, enabled);
155+
info!(
156+
"[GatewayCmd] Toggling gateway MCP {} to {}",
157+
mcp_id, enabled
158+
);
161159
let db = db.lock().map_err(|e| e.to_string())?;
162-
db.toggle_gateway_mcp(mcp_id, enabled).map_err(|e| e.to_string())
160+
db.toggle_gateway_mcp(mcp_id, enabled)
161+
.map_err(|e| e.to_string())
163162
}
164163

165164
/// Set auto-restart for a gateway MCP
@@ -169,17 +168,18 @@ pub fn set_gateway_mcp_auto_restart(
169168
mcp_id: i64,
170169
auto_restart: bool,
171170
) -> Result<(), String> {
172-
info!("[GatewayCmd] Setting gateway MCP {} auto_restart to {}", mcp_id, auto_restart);
171+
info!(
172+
"[GatewayCmd] Setting gateway MCP {} auto_restart to {}",
173+
mcp_id, auto_restart
174+
);
173175
let db = db.lock().map_err(|e| e.to_string())?;
174-
db.set_gateway_mcp_auto_restart(mcp_id, auto_restart).map_err(|e| e.to_string())
176+
db.set_gateway_mcp_auto_restart(mcp_id, auto_restart)
177+
.map_err(|e| e.to_string())
175178
}
176179

177180
/// Check if an MCP is in the gateway
178181
#[tauri::command]
179-
pub fn is_mcp_in_gateway(
180-
db: State<'_, Arc<Mutex<Database>>>,
181-
mcp_id: i64,
182-
) -> Result<bool, String> {
182+
pub fn is_mcp_in_gateway(db: State<'_, Arc<Mutex<Database>>>, mcp_id: i64) -> Result<bool, String> {
183183
let db = db.lock().map_err(|e| e.to_string())?;
184184
db.is_mcp_in_gateway(mcp_id).map_err(|e| e.to_string())
185185
}

src-tauri/src/commands/mcp_server.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ pub fn add_self_mcp_to_library(
120120

121121
/// Remove the Tool Manager MCP from the library
122122
#[tauri::command]
123-
pub fn remove_self_mcp_from_library(
124-
db: State<'_, Arc<Mutex<Database>>>,
125-
) -> Result<(), String> {
123+
pub fn remove_self_mcp_from_library(db: State<'_, Arc<Mutex<Database>>>) -> Result<(), String> {
126124
info!("[McpServerCmd] Removing Tool Manager MCP from library");
127125

128126
let db = db.lock().map_err(|e| e.to_string())?;
@@ -136,11 +134,10 @@ pub fn remove_self_mcp_from_library(
136134

137135
/// Check if the Tool Manager MCP is in the library
138136
#[tauri::command]
139-
pub fn is_self_mcp_in_library(
140-
db: State<'_, Arc<Mutex<Database>>>,
141-
) -> Result<bool, String> {
137+
pub fn is_self_mcp_in_library(db: State<'_, Arc<Mutex<Database>>>) -> Result<bool, String> {
142138
let db = db.lock().map_err(|e| e.to_string())?;
143-
let exists = db.get_mcp_by_name("Tool Manager MCP")
139+
let exists = db
140+
.get_mcp_by_name("Tool Manager MCP")
144141
.map(|opt| opt.is_some())
145142
.unwrap_or(false);
146143
Ok(exists)

src-tauri/src/commands/mcp_session.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ pub fn start_mcp_session(
8686
// System MCPs (Tool Manager and Gateway) use Streamable HTTP transport
8787
if source == "system" {
8888
let mcp_url = url.ok_or_else(|| "System MCP requires a URL".to_string())?;
89-
info!("[MCP Session] Starting Streamable HTTP session for system MCP: {}", name);
89+
info!(
90+
"[MCP Session] Starting Streamable HTTP session for system MCP: {}",
91+
name
92+
);
9093
return manager
9194
.start_streamable_http_session(mcp_id, &name, &mcp_url, headers.as_ref(), 60)
9295
.map_err(|e| e.to_string());

src-tauri/src/commands/mcp_test.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,15 @@ pub fn test_mcp(db: State<'_, Arc<Mutex<Database>>>, mcp_id: i64) -> Result<McpT
7171
// async SSE handling for full protocol test
7272
if source == "system" {
7373
let mcp_url = url.ok_or_else(|| "System MCP requires a URL".to_string())?;
74-
info!("[MCP Test] Testing system MCP with Streamable HTTP: {}", mcp_url);
75-
return Ok(mcp_client::test_streamable_http_mcp(&mcp_url, headers.as_ref(), 30));
74+
info!(
75+
"[MCP Test] Testing system MCP with Streamable HTTP: {}",
76+
mcp_url
77+
);
78+
return Ok(mcp_client::test_streamable_http_mcp(
79+
&mcp_url,
80+
headers.as_ref(),
81+
30,
82+
));
7683
}
7784

7885
// Now the database lock is released, perform the test

src-tauri/src/commands/projects.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ pub fn toggle_project_mcp(
259259
}
260260

261261
#[tauri::command]
262-
pub fn sync_project_config(db: State<'_, Arc<Mutex<Database>>>, project_id: i64) -> Result<(), String> {
262+
pub fn sync_project_config(
263+
db: State<'_, Arc<Mutex<Database>>>,
264+
project_id: i64,
265+
) -> Result<(), String> {
263266
use crate::services::opencode_config;
264267
use crate::utils::paths::get_claude_paths;
265268

src-tauri/src/commands/repos.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ pub fn remove_repo(db: State<'_, Arc<Mutex<Database>>>, id: i64) -> Result<(), S
108108

109109
/// Toggle repository enabled status
110110
#[tauri::command]
111-
pub fn toggle_repo(db: State<'_, Arc<Mutex<Database>>>, id: i64, enabled: bool) -> Result<(), String> {
111+
pub fn toggle_repo(
112+
db: State<'_, Arc<Mutex<Database>>>,
113+
id: i64,
114+
enabled: bool,
115+
) -> Result<(), String> {
112116
let db = db.lock().map_err(|e| e.to_string())?;
113117

114118
db.conn()

src-tauri/src/commands/skills.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ pub fn add_global_skill(db: State<'_, Arc<Mutex<Database>>>, skill_id: i64) -> R
206206
}
207207

208208
#[tauri::command]
209-
pub fn remove_global_skill(db: State<'_, Arc<Mutex<Database>>>, skill_id: i64) -> Result<(), String> {
209+
pub fn remove_global_skill(
210+
db: State<'_, Arc<Mutex<Database>>>,
211+
skill_id: i64,
212+
) -> Result<(), String> {
210213
let db_guard = db.lock().map_err(|e| e.to_string())?;
211214

212215
// Get the skill for file deletion

src-tauri/src/commands/subagents.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ pub fn delete_subagent(db: State<'_, Arc<Mutex<Database>>>, id: i64) -> Result<(
167167

168168
// Global Sub-Agents
169169
#[tauri::command]
170-
pub fn get_global_subagents(db: State<'_, Arc<Mutex<Database>>>) -> Result<Vec<GlobalSubAgent>, String> {
170+
pub fn get_global_subagents(
171+
db: State<'_, Arc<Mutex<Database>>>,
172+
) -> Result<Vec<GlobalSubAgent>, String> {
171173
let db = db.lock().map_err(|e| e.to_string())?;
172174
let mut stmt = db
173175
.conn()
@@ -197,7 +199,10 @@ pub fn get_global_subagents(db: State<'_, Arc<Mutex<Database>>>) -> Result<Vec<G
197199
}
198200

199201
#[tauri::command]
200-
pub fn add_global_subagent(db: State<'_, Arc<Mutex<Database>>>, subagent_id: i64) -> Result<(), String> {
202+
pub fn add_global_subagent(
203+
db: State<'_, Arc<Mutex<Database>>>,
204+
subagent_id: i64,
205+
) -> Result<(), String> {
201206
let db_guard = db.lock().map_err(|e| e.to_string())?;
202207

203208
// Get the subagent details for file writing

0 commit comments

Comments
 (0)