Skip to content

Commit b7016de

Browse files
committed
chore(fmt): apply cargo fmt after validate sweep
Autonomous decisions: - Commit fmt-only diffs from pnpm validate cargo fmt --all Signed-off-by: crimsonsunset <jsangio1@gmail.com>
1 parent c090948 commit b7016de

5 files changed

Lines changed: 65 additions & 63 deletions

File tree

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ pub async fn clone_server(
2323
let space_uuid = uuid::Uuid::parse_str(&space_id).map_err(|e| e.to_string())?;
2424

2525
service
26-
.clone_server(
27-
space_uuid,
28-
&source_server_id,
29-
&suffix,
30-
alias.as_deref(),
31-
)
26+
.clone_server(space_uuid, &source_server_id, &suffix, alias.as_deref())
3227
.await
3328
.map_err(|e| e.to_string())
3429
}

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use std::sync::Arc;
88
use tracing::{info, warn};
99
use uuid::Uuid;
1010

11-
use crate::domain::{DomainEvent, InstallationSource, InstalledServer, ServerDefinition, UserServerEntry};
11+
use crate::domain::{
12+
DomainEvent, InstallationSource, InstalledServer, ServerDefinition, UserServerEntry,
13+
};
1214
use crate::event_bus::EventSender;
1315
use crate::repository::{CredentialRepository, InstalledServerRepository, ServerFeatureRepository};
1416

@@ -769,7 +771,8 @@ mod tests {
769771

770772
assert_eq!(cloned.server_id, "posthog-mywork");
771773
assert_eq!(
772-
cloned.get_definition()
774+
cloned
775+
.get_definition()
773776
.and_then(|definition| definition.alias),
774777
Some("mywork".to_string())
775778
);
@@ -829,7 +832,10 @@ mod tests {
829832
.expect("dependents lookup");
830833

831834
assert_eq!(dependents.len(), 2);
832-
let ids: Vec<_> = dependents.iter().map(|server| server.server_id.as_str()).collect();
835+
let ids: Vec<_> = dependents
836+
.iter()
837+
.map(|server| server.server_id.as_str())
838+
.collect();
833839
assert!(ids.contains(&"posthog-work"));
834840
assert!(ids.contains(&"posthog-personal"));
835841
}
@@ -856,17 +862,15 @@ mod tests {
856862
.await
857863
.expect("clone uninstall");
858864

859-
assert!(
860-
repo.get_by_server_id(&space_id_str, "posthog")
861-
.await
862-
.expect("lookup source")
863-
.is_some()
864-
);
865-
assert!(
866-
repo.get_by_server_id(&space_id_str, "posthog-work")
867-
.await
868-
.expect("lookup clone")
869-
.is_none()
870-
);
865+
assert!(repo
866+
.get_by_server_id(&space_id_str, "posthog")
867+
.await
868+
.expect("lookup source")
869+
.is_some());
870+
assert!(repo
871+
.get_by_server_id(&space_id_str, "posthog-work")
872+
.await
873+
.expect("lookup clone")
874+
.is_none());
871875
}
872876
}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ impl SqliteWorkspaceBindingRepository {
140140
Ok(())
141141
}
142142

143-
const SELECT_COLS: &'static str =
144-
"id, workspace_root, label, space_id, created_at, updated_at";
143+
const SELECT_COLS: &'static str = "id, workspace_root, label, space_id, created_at, updated_at";
145144

146145
/// Fetch bindings + their FeatureSet lists in two queries.
147146
/// `where_clause` is appended to the binding SELECT (use `""` for none);
@@ -376,7 +375,11 @@ mod tests {
376375
#[tokio::test]
377376
async fn test_label_round_trip() {
378377
let (repo, space_id, fs_id) = fixture().await;
379-
let root = if cfg!(windows) { "d:\\labeled" } else { "/labeled" };
378+
let root = if cfg!(windows) {
379+
"d:\\labeled"
380+
} else {
381+
"/labeled"
382+
};
380383
let mut binding = WorkspaceBinding::new(root, space_id, fs_id);
381384
binding.label = Some("My Project".to_string());
382385
repo.create(&binding).await.unwrap();

tests/rust/tests/integration/meta_tools.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,8 @@ async fn list_servers_includes_cloned_from_for_clone_installs() {
371371
let space_id = f.space_id.to_string();
372372

373373
let posthog = InstalledServer::new(&space_id, "posthog");
374-
f.installed_server_repo
375-
.install(&posthog)
376-
.await
377-
.unwrap();
378-
let posthog_work = InstalledServer::new(&space_id, "posthog-work")
379-
.with_cloned_from("posthog");
374+
f.installed_server_repo.install(&posthog).await.unwrap();
375+
let posthog_work = InstalledServer::new(&space_id, "posthog-work").with_cloned_from("posthog");
380376
f.installed_server_repo
381377
.install(&posthog_work)
382378
.await

tests/rust/tests/integration/server_clone.rs

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::sync::Arc;
55

66
use mcpmux_core::{
77
application::ServerAppService, EventBus, InstalledServer, InstalledServerRepository,
8-
ServerDefinition, ServerDiscoveryService, ServerFeature, ServerFeatureRepository,
9-
ServerSource, SpaceRepository, TransportConfig, TransportMetadata,
8+
ServerDefinition, ServerDiscoveryService, ServerFeature, ServerFeatureRepository, ServerSource,
9+
SpaceRepository, TransportConfig, TransportMetadata,
1010
};
1111
use mcpmux_gateway::{FeatureService, PrefixCacheService, SessionOverrideRegistry};
1212
use mcpmux_storage::{
@@ -38,21 +38,18 @@ impl CloneFixture {
3838
let default_space = space_repo.get_default().await.unwrap().unwrap();
3939
let space_id = default_space.id;
4040

41-
let installed_server_repo: Arc<dyn InstalledServerRepository> = Arc::new(
42-
SqliteInstalledServerRepository::new(db.clone(), encryptor),
43-
);
41+
let installed_server_repo: Arc<dyn InstalledServerRepository> =
42+
Arc::new(SqliteInstalledServerRepository::new(db.clone(), encryptor));
4443
let feature_repo: Arc<dyn ServerFeatureRepository> =
4544
Arc::new(SqliteServerFeatureRepository::new(db));
4645

47-
let prefix_cache = Arc::new(
48-
PrefixCacheService::new().with_dependencies(
49-
installed_server_repo.clone(),
50-
Arc::new(ServerDiscoveryService::new(
51-
std::env::temp_dir().join(format!("mcpmux-clone-test-{}", Uuid::new_v4())),
52-
std::env::temp_dir().join(format!("mcpmux-clone-spaces-{}", Uuid::new_v4())),
53-
)),
54-
),
55-
);
46+
let prefix_cache = Arc::new(PrefixCacheService::new().with_dependencies(
47+
installed_server_repo.clone(),
48+
Arc::new(ServerDiscoveryService::new(
49+
std::env::temp_dir().join(format!("mcpmux-clone-test-{}", Uuid::new_v4())),
50+
std::env::temp_dir().join(format!("mcpmux-clone-spaces-{}", Uuid::new_v4())),
51+
)),
52+
));
5653
let feature_service = Arc::new(FeatureService::new(
5754
feature_repo.clone(),
5855
Arc::new(tests::mocks::MockFeatureSetRepository::new()),
@@ -240,7 +237,10 @@ async fn two_clones_have_distinct_prefixes_and_env() {
240237
Some("work-account")
241238
);
242239
assert_eq!(
243-
stored_personal.input_values.get("ACCOUNT").map(String::as_str),
240+
stored_personal
241+
.input_values
242+
.get("ACCOUNT")
243+
.map(String::as_str),
244244
Some("personal-account")
245245
);
246246
assert_eq!(clone_work.cloned_from.as_deref(), Some("posthog"));
@@ -272,22 +272,18 @@ async fn uninstall_clone_does_not_affect_source() {
272272
.await
273273
.expect("clone uninstall");
274274

275-
assert!(
276-
fixture
277-
.installed_server_repo
278-
.get_by_server_id(&space_id_str, "posthog")
279-
.await
280-
.unwrap()
281-
.is_some()
282-
);
283-
assert!(
284-
fixture
285-
.installed_server_repo
286-
.get_by_server_id(&space_id_str, "posthog-work")
287-
.await
288-
.unwrap()
289-
.is_none()
290-
);
275+
assert!(fixture
276+
.installed_server_repo
277+
.get_by_server_id(&space_id_str, "posthog")
278+
.await
279+
.unwrap()
280+
.is_some());
281+
assert!(fixture
282+
.installed_server_repo
283+
.get_by_server_id(&space_id_str, "posthog-work")
284+
.await
285+
.unwrap()
286+
.is_none());
291287
}
292288

293289
#[tokio::test(flavor = "multi_thread")]
@@ -339,11 +335,19 @@ async fn clone_prefixes_do_not_break_existing_alias_uniqueness() {
339335
let other = fixtures::test_installed_server(&space_id_str, "other-server")
340336
.with_definition(&env_stdio_definition("other-server", "Other", "api"));
341337

342-
fixture.installed_server_repo.install(&posthog).await.unwrap();
338+
fixture
339+
.installed_server_repo
340+
.install(&posthog)
341+
.await
342+
.unwrap();
343343
fixture.installed_server_repo.install(&other).await.unwrap();
344344

345345
let clone = InstalledServer::new(&space_id_str, "posthog-work")
346-
.with_definition(&env_stdio_definition("posthog-work", "PostHog (work)", "work"))
346+
.with_definition(&env_stdio_definition(
347+
"posthog-work",
348+
"PostHog (work)",
349+
"work",
350+
))
347351
.with_cloned_from("posthog");
348352
fixture.installed_server_repo.install(&clone).await.unwrap();
349353

0 commit comments

Comments
 (0)