style: cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 16:19:45 +01:00
1 parent 1027ef6161
commit 7d338e6d30
4 files changed
+24 -7

No files matched your search

+6 -2
View File
@@ -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/1", Some("x")).unwrap();
g.set_module_data("a.mod", "entry/2", Some("y")).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("a.mod", "vault", Some("h")).unwrap();
g.set_module_data("b.mod", "entry/1", Some("other")).unwrap(); g.set_module_data("b.mod", "entry/1", Some("other"))
assert_eq!(g.module_data("a.mod", "entry/1").unwrap().as_deref(), Some("x")); .unwrap();
assert_eq!(
g.module_data("a.mod", "entry/1").unwrap().as_deref(),
Some("x")
);
let keys: Vec<_> = g let keys: Vec<_> = g
.module_data_list("a.mod", "entry/") .module_data_list("a.mod", "entry/")
.unwrap() .unwrap()
+5 -1
View File
@@ -404,7 +404,11 @@ impl ModuleDto {
version: m.version.clone(), version: m.version.clone(),
description: m.description.clone(), description: m.description.clone(),
author: m.author.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: m
.views .views
.iter() .iter()
+3 -1
View File
@@ -202,7 +202,9 @@ impl History {
Op::DeletePage { id } => touched.extend(graph.hub_members(id)?), Op::DeletePage { id } => touched.extend(graph.hub_members(id)?),
// Deletions and moves do not say which page lost a block; those // Deletions and moves do not say which page lost a block; those
// pages are caught by the `updated_at` scan below. // pages are caught by the `updated_at` scan below.
Op::DeleteBlock { .. } | Op::PutAsset { .. } | Op::PutTypeDef { .. } Op::DeleteBlock { .. }
| Op::PutAsset { .. }
| Op::PutTypeDef { .. }
| Op::PutModuleData { .. } => {} | Op::PutModuleData { .. } => {}
// The previous owner of an alias is unknown. // The previous owner of an alias is unknown.
Op::SetAlias { .. } => everything = true, Op::SetAlias { .. } => everything = true,
+10 -3
View File
@@ -108,13 +108,17 @@ impl Running {
.func_wrap( .func_wrap(
"synapse", "synapse",
"call", "call",
|mut caller: Caller<'_, HostState>, ptr: i32, len: i32| -> Result<i32, wasmi::Error> { |mut caller: Caller<'_, HostState>,
ptr: i32,
len: i32|
-> Result<i32, wasmi::Error> {
let req = read_bytes(&caller, ptr, len)?; let req = read_bytes(&caller, ptr, len)?;
let reply = match dispatch(caller.data_mut(), &req) { let reply = match dispatch(caller.data_mut(), &req) {
Ok(v) => json!({ "ok": v }), Ok(v) => json!({ "ok": v }),
Err(e) => json!({ "error": e.to_string() }), 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 { if bytes.len() > MAX_MESSAGE {
return Err(wasmi::Error::new("host reply too large")); return Err(wasmi::Error::new("host reply too large"));
} }
@@ -139,7 +143,10 @@ impl Running {
l.func_wrap( l.func_wrap(
"synapse", "synapse",
"respond", "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)?; let bytes = read_bytes(&caller, ptr, len)?;
caller.data_mut().response = Some(bytes); caller.data_mut().response = Some(bytes);
Ok(()) Ok(())