style: cargo fmt after Phase A

Whitespace + import-grouping fixups in the 9 SDK modules touched by
F-Q-002. No behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-06-07 20:02:19 +02:00
parent ae5cf80426
commit 6f2bd3e949
8 changed files with 76 additions and 41 deletions

View File

@@ -84,8 +84,10 @@ fn register_get(engine: &mut RhaiEngine) {
"get",
|handle: &mut KvHandle, key: &str| -> Result<Dynamic, Box<EvalAltResult>> {
let h = handle.clone();
block_on("kv", async move { h.service.get(&h.cx, &h.collection, key).await })
.map(|opt| opt.map_or(Dynamic::UNIT, json_to_dynamic))
block_on("kv", async move {
h.service.get(&h.cx, &h.collection, key).await
})
.map(|opt| opt.map_or(Dynamic::UNIT, json_to_dynamic))
},
);
}
@@ -96,7 +98,9 @@ fn register_set(engine: &mut RhaiEngine) {
|handle: &mut KvHandle, key: &str, value: Dynamic| -> Result<(), Box<EvalAltResult>> {
let h = handle.clone();
let json = dynamic_to_json(&value);
block_on("kv", async move { h.service.set(&h.cx, &h.collection, key, json).await })
block_on("kv", async move {
h.service.set(&h.cx, &h.collection, key, json).await
})
},
);
}
@@ -106,7 +110,9 @@ fn register_has(engine: &mut RhaiEngine) {
"has",
|handle: &mut KvHandle, key: &str| -> Result<bool, Box<EvalAltResult>> {
let h = handle.clone();
block_on("kv", async move { h.service.has(&h.cx, &h.collection, key).await })
block_on("kv", async move {
h.service.has(&h.cx, &h.collection, key).await
})
},
);
}
@@ -116,7 +122,9 @@ fn register_delete(engine: &mut RhaiEngine) {
"delete",
|handle: &mut KvHandle, key: &str| -> Result<bool, Box<EvalAltResult>> {
let h = handle.clone();
block_on("kv", async move { h.service.delete(&h.cx, &h.collection, key).await })
block_on("kv", async move {
h.service.delete(&h.cx, &h.collection, key).await
})
},
);
}
@@ -166,4 +174,3 @@ fn list_call(
);
Ok(m)
}