From 7d338e6d309527d3def2dd64d947887b21e17827 Mon Sep 17 00:00:00 2001 From: Dasemu Date: Mon, 26 Oct 2026 16:19:45 +0100 Subject: [PATCH] style: cargo fmt Co-Authored-By: Claude Opus 5.5 --- crates/synapse-core/tests/module_data.rs | 8 ++++++-- crates/synapse-ffi/src/api/dto.rs | 6 +++++- crates/synapse-history/src/history.rs | 4 +++- crates/synapse-modules/src/host.rs | 13 ++++++++++--- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/crates/synapse-core/tests/module_data.rs b/crates/synapse-core/tests/module_data.rs index 6e8877f..6feabdb 100644 --- a/crates/synapse-core/tests/module_data.rs +++ b/crates/synapse-core/tests/module_data.rs @@ -21,8 +21,12 @@ fn module_data_is_namespaced_listed_and_deleted() { g.set_module_data("a.mod", "entry/1", Some("x")).unwrap(); g.set_module_data("a.mod", "entry/2", Some("y")).unwrap(); g.set_module_data("a.mod", "vault", Some("h")).unwrap(); - g.set_module_data("b.mod", "entry/1", Some("other")).unwrap(); - assert_eq!(g.module_data("a.mod", "entry/1").unwrap().as_deref(), Some("x")); + g.set_module_data("b.mod", "entry/1", Some("other")) + .unwrap(); + assert_eq!( + g.module_data("a.mod", "entry/1").unwrap().as_deref(), + Some("x") + ); let keys: Vec<_> = g .module_data_list("a.mod", "entry/") .unwrap() diff --git a/crates/synapse-ffi/src/api/dto.rs b/crates/synapse-ffi/src/api/dto.rs index 56f232e..a8f1080 100644 --- a/crates/synapse-ffi/src/api/dto.rs +++ b/crates/synapse-ffi/src/api/dto.rs @@ -404,7 +404,11 @@ impl ModuleDto { version: m.version.clone(), description: m.description.clone(), author: m.author.clone(), - permissions: m.permissions.iter().map(|p| p.as_str().to_string()).collect(), + permissions: m + .permissions + .iter() + .map(|p| p.as_str().to_string()) + .collect(), views: m .views .iter() diff --git a/crates/synapse-history/src/history.rs b/crates/synapse-history/src/history.rs index 774d815..e43db80 100644 --- a/crates/synapse-history/src/history.rs +++ b/crates/synapse-history/src/history.rs @@ -202,7 +202,9 @@ impl History { Op::DeletePage { id } => touched.extend(graph.hub_members(id)?), // Deletions and moves do not say which page lost a block; those // pages are caught by the `updated_at` scan below. - Op::DeleteBlock { .. } | Op::PutAsset { .. } | Op::PutTypeDef { .. } + Op::DeleteBlock { .. } + | Op::PutAsset { .. } + | Op::PutTypeDef { .. } | Op::PutModuleData { .. } => {} // The previous owner of an alias is unknown. Op::SetAlias { .. } => everything = true, diff --git a/crates/synapse-modules/src/host.rs b/crates/synapse-modules/src/host.rs index bd46126..276b049 100644 --- a/crates/synapse-modules/src/host.rs +++ b/crates/synapse-modules/src/host.rs @@ -108,13 +108,17 @@ impl Running { .func_wrap( "synapse", "call", - |mut caller: Caller<'_, HostState>, ptr: i32, len: i32| -> Result { + |mut caller: Caller<'_, HostState>, + ptr: i32, + len: i32| + -> Result { let req = read_bytes(&caller, ptr, len)?; let reply = match dispatch(caller.data_mut(), &req) { Ok(v) => json!({ "ok": v }), Err(e) => json!({ "error": e.to_string() }), }; - let bytes = serde_json::to_vec(&reply).map_err(|e| wasmi::Error::new(e.to_string()))?; + let bytes = + serde_json::to_vec(&reply).map_err(|e| wasmi::Error::new(e.to_string()))?; if bytes.len() > MAX_MESSAGE { return Err(wasmi::Error::new("host reply too large")); } @@ -139,7 +143,10 @@ impl Running { l.func_wrap( "synapse", "respond", - |mut caller: Caller<'_, HostState>, ptr: i32, len: i32| -> Result<(), wasmi::Error> { + |mut caller: Caller<'_, HostState>, + ptr: i32, + len: i32| + -> Result<(), wasmi::Error> { let bytes = read_bytes(&caller, ptr, len)?; caller.data_mut().response = Some(bytes); Ok(())