Skip to content

Commit 22150c0

Browse files
committed
style: rustfmt reflow after client-mapping reconciliation port
Mechanical line-wrap changes from cargo fmt --all — resolver.resolve() calls now exceed the 100-char width after the extra param added across Phases 1-4 of the upstream-client-mapping-reconciliation port. No logic changes. Signed-off-by: crimsonsunset <jsangio1@gmail.com>
1 parent 3eb678c commit 22150c0

15 files changed

Lines changed: 134 additions & 65 deletions

File tree

apps/desktop/src-tauri/src/commands/oauth.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,7 @@ pub async fn register_api_key_client(
768768
.as_deref()
769769
.map(str::trim)
770770
.filter(|s| !s.is_empty())
771-
.map(|s| {
772-
uuid::Uuid::parse_str(s).map_err(|_| format!("Invalid locked_space_id: {s}"))
773-
})
771+
.map(|s| uuid::Uuid::parse_str(s).map_err(|_| format!("Invalid locked_space_id: {s}")))
774772
.transpose()?;
775773
if let Some(space_id) = locked_space {
776774
repo.set_locked_space(&client_id, Some(space_id))

apps/desktop/src-tauri/src/commands/workspace_binding.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use std::collections::{HashMap, HashSet};
88
use std::sync::Arc;
99

1010
use mcpmux_core::{
11-
normalize_optional_metadata, validate_workspace_root as validate_root, BindingType, DomainEvent,
12-
FeatureSet, FeatureSetType, MemberMode, MemberType, ServerFeature, WorkspaceBinding,
13-
WorkspaceRootValidation,
11+
normalize_optional_metadata, validate_workspace_root as validate_root, BindingType,
12+
DomainEvent, FeatureSet, FeatureSetType, MemberMode, MemberType, ServerFeature,
13+
WorkspaceBinding, WorkspaceRootValidation,
1414
};
1515
use serde::{Deserialize, Serialize};
1616
use tauri::State;
@@ -411,8 +411,7 @@ pub async fn create_workspace_binding(
411411
.await
412412
.map_err(|e| e.to_string())?;
413413
if existing.iter().any(|b| {
414-
b.binding_type == binding_type
415-
&& binding_scope_conflicts(b, &normalized, machine_id, None)
414+
b.binding_type == binding_type && binding_scope_conflicts(b, &normalized, machine_id, None)
416415
}) {
417416
let noun = if binding_type == BindingType::Id {
418417
"client mapping"

crates/mcpmux-core/src/application/user_space_sync.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ mod tests {
381381
fail_ids.extend(server_ids.iter().map(|id| (*id).to_string()));
382382
}
383383

384-
async fn get_server_by_server_id(&self, space_id: &str, server_id: &str) -> Option<InstalledServer> {
384+
async fn get_server_by_server_id(
385+
&self,
386+
space_id: &str,
387+
server_id: &str,
388+
) -> Option<InstalledServer> {
385389
self.servers
386390
.read()
387391
.await
@@ -401,7 +405,10 @@ mod tests {
401405
Ok(self.servers.read().await.clone())
402406
}
403407

404-
async fn list_for_space(&self, space_id: &str) -> crate::repository::RepoResult<Vec<InstalledServer>> {
408+
async fn list_for_space(
409+
&self,
410+
space_id: &str,
411+
) -> crate::repository::RepoResult<Vec<InstalledServer>> {
405412
Ok(self
406413
.servers
407414
.read()
@@ -470,7 +477,10 @@ mod tests {
470477
Ok(())
471478
}
472479

473-
async fn list_enabled(&self, space_id: &str) -> crate::repository::RepoResult<Vec<InstalledServer>> {
480+
async fn list_enabled(
481+
&self,
482+
space_id: &str,
483+
) -> crate::repository::RepoResult<Vec<InstalledServer>> {
474484
Ok(self
475485
.servers
476486
.read()
@@ -617,7 +627,10 @@ mod tests {
617627
file_path: file_path.clone()
618628
}
619629
);
620-
assert_eq!(adopted.server_name.as_deref(), Some("Home Assistant Config"));
630+
assert_eq!(
631+
adopted.server_name.as_deref(),
632+
Some("Home Assistant Config")
633+
);
621634
}
622635

623636
#[tokio::test]

crates/mcpmux-gateway/src/admin/command_bridge/read.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,7 @@ pub async fn get_workspace_effective_features(
428428
binding.space_id,
429429
binding.feature_set_ids,
430430
),
431-
None => (
432-
"unbound".to_string(),
433-
None,
434-
default_space.id,
435-
vec![],
436-
),
431+
None => ("unbound".to_string(), None, default_space.id, vec![]),
437432
};
438433

439434
let space = ctx

crates/mcpmux-gateway/src/admin/handlers/read.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,10 @@ pub async fn get_workspace_effective_features(
405405
State(state): State<AdminState>,
406406
Query(query): Query<EffectiveFeaturesQuery>,
407407
) -> Result<Json<Value>, ApiError> {
408-
bridge::get_workspace_effective_features(
409-
&state.bridge,
410-
query.workspace_root,
411-
query.machine_id,
412-
)
413-
.await
414-
.map(ok)
415-
.map_err(ApiError::from_bridge)
408+
bridge::get_workspace_effective_features(&state.bridge, query.workspace_root, query.machine_id)
409+
.await
410+
.map(ok)
411+
.map_err(ApiError::from_bridge)
416412
}
417413

418414
pub async fn list_workspace_appearances(

crates/mcpmux-gateway/src/public_base_url.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub fn normalize_public_url(url: &str) -> Result<String, String> {
3333
}
3434
if parsed.path() != "/" && !parsed.path().is_empty() {
3535
return Err(
36-
"Public gateway URL must be an origin only, for example https://mcp.example.com"
37-
.into(),
36+
"Public gateway URL must be an origin only, for example https://mcp.example.com".into(),
3837
);
3938
}
4039

crates/mcpmux-gateway/src/services/meta_tools/bind_workspace.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ use super::registry::{MetaTool, MetaToolCall, MetaToolError};
1616
pub struct BindCurrentWorkspaceTool;
1717

1818
/// Machine identity for this bind — header, then OAuth client machine, then gateway local.
19-
async fn effective_machine_for_bind(call: &MetaToolCall<'_>) -> Result<Option<Uuid>, MetaToolError> {
19+
async fn effective_machine_for_bind(
20+
call: &MetaToolCall<'_>,
21+
) -> Result<Option<Uuid>, MetaToolError> {
2022
call.ctx
2123
.resolver
2224
.effective_machine_id(Some(call.client_id), call.request_machine_id)
@@ -39,11 +41,7 @@ async fn find_existing_binding_for_bind(
3941
.map_err(|e| MetaToolError::Internal(e.to_string()));
4042
}
4143
binding_repo
42-
.find_longest_prefix_match(
43-
space_id,
44-
Some(client_id),
45-
&[normalized.to_string()],
46-
)
44+
.find_longest_prefix_match(space_id, Some(client_id), &[normalized.to_string()])
4745
.await
4846
.map_err(|e| MetaToolError::Internal(e.to_string()))
4947
}
@@ -73,10 +71,7 @@ async fn bind_tool_result(input: BindToolResultInput<'_>) -> Result<CallToolResu
7371
)
7472
.await
7573
.map_err(|e| MetaToolError::Internal(e.to_string()))?;
76-
let active = resolved
77-
.feature_set_ids
78-
.iter()
79-
.any(|id| id == &fs_id_str);
74+
let active = resolved.feature_set_ids.iter().any(|id| id == &fs_id_str);
8075

8176
let mut body = json!({
8277
"ok": true,

crates/mcpmux-gateway/src/services/meta_tools/meta_tool_common.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ pub(crate) async fn caller_space_id(call: &MetaToolCall<'_>) -> Result<Uuid, Met
5858
let resolved = call
5959
.ctx
6060
.resolver
61-
.resolve(call.session_id, Some(call.client_id), call.request_machine_id)
61+
.resolve(
62+
call.session_id,
63+
Some(call.client_id),
64+
call.request_machine_id,
65+
)
6266
.await?;
6367
if let Some(space_id) = resolved.space_id {
6468
return Ok(space_id);
@@ -76,7 +80,11 @@ pub(crate) async fn caller_resolution(
7680
) -> Result<ResolvedFeatureSet, MetaToolError> {
7781
call.ctx
7882
.resolver
79-
.resolve(call.session_id, Some(call.client_id), call.request_machine_id)
83+
.resolve(
84+
call.session_id,
85+
Some(call.client_id),
86+
call.request_machine_id,
87+
)
8088
.await
8189
.map_err(|e| MetaToolError::Internal(e.to_string()))
8290
}

crates/mcpmux-gateway/src/services/meta_tools/set_workspace_root.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ impl MetaTool for SetWorkspaceRootTool {
7777
let resolved = call
7878
.ctx
7979
.resolver
80-
.resolve(Some(session_id), Some(call.client_id), call.request_machine_id)
80+
.resolve(
81+
Some(session_id),
82+
Some(call.client_id),
83+
call.request_machine_id,
84+
)
8185
.await?;
8286

8387
let space_id = resolved

crates/mcpmux-storage/src/repositories/workspace_binding_repository.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ impl WorkspaceBindingRepository for SqliteWorkspaceBindingRepository {
316316
// Exact match only — no ancestor/prefix inheritance. A folder resolves
317317
// to a binding for THAT exact root, or to nothing.
318318
for root in candidate_roots {
319-
if let Some(b) = bindings.iter().find(|b| {
320-
b.binding_type == BindingType::Path && &b.workspace_root == root
321-
}) {
319+
if let Some(b) = bindings
320+
.iter()
321+
.find(|b| b.binding_type == BindingType::Path && &b.workspace_root == root)
322+
{
322323
return Ok(Some(b.clone()));
323324
}
324325
}

0 commit comments

Comments
 (0)