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

@@ -23,9 +23,9 @@
use std::sync::Arc;
use super::bridge::block_on;
use picloud_shared::{FileMeta, FileUpdate, FilesService, NewFile, SdkCallCx, Services};
use rhai::{Array, Dynamic, Engine as RhaiEngine, EvalAltResult, Map, Module};
use super::bridge::block_on;
/// Per-call handle captured by the Rhai SDK. Cheap to clone (two Arcs
/// plus an owned string).
@@ -82,7 +82,9 @@ fn register_create(engine: &mut RhaiEngine) {
content_type,
data,
};
let id = block_on("files", async move { h.service.create(&h.cx, &h.collection, new).await })?;
let id = block_on("files", async move {
h.service.create(&h.cx, &h.collection, new).await
})?;
Ok(id.to_string())
},
);
@@ -94,7 +96,9 @@ fn register_head(engine: &mut RhaiEngine) {
|handle: &mut FilesHandle, id: &str| -> Result<Dynamic, Box<EvalAltResult>> {
let h = handle.clone();
let id = id.to_string();
let meta = block_on("files", async move { h.service.head(&h.cx, &h.collection, &id).await })?;
let meta = block_on("files", async move {
h.service.head(&h.cx, &h.collection, &id).await
})?;
Ok(meta.map_or(Dynamic::UNIT, |m| file_meta_to_map(&m).into()))
},
);
@@ -106,7 +110,9 @@ fn register_get(engine: &mut RhaiEngine) {
|handle: &mut FilesHandle, id: &str| -> Result<Dynamic, Box<EvalAltResult>> {
let h = handle.clone();
let id = id.to_string();
let bytes = block_on("files", async move { h.service.get(&h.cx, &h.collection, &id).await })?;
let bytes = block_on("files", async move {
h.service.get(&h.cx, &h.collection, &id).await
})?;
Ok(bytes.map_or(Dynamic::UNIT, Dynamic::from_blob))
},
);
@@ -126,7 +132,9 @@ fn register_update(engine: &mut RhaiEngine) {
name,
content_type,
};
block_on("files", async move { h.service.update(&h.cx, &h.collection, &id, upd).await })
block_on("files", async move {
h.service.update(&h.cx, &h.collection, &id, upd).await
})
},
);
}
@@ -137,7 +145,9 @@ fn register_delete(engine: &mut RhaiEngine) {
|handle: &mut FilesHandle, id: &str| -> Result<bool, Box<EvalAltResult>> {
let h = handle.clone();
let id = id.to_string();
block_on("files", async move { h.service.delete(&h.cx, &h.collection, &id).await })
block_on("files", async move {
h.service.delete(&h.cx, &h.collection, &id).await
})
},
);
}
@@ -257,4 +267,3 @@ fn require_blob(meta: &Map, field: &'static str) -> Result<Vec<u8>, Box<EvalAltR
None => Err(format!("files: missing required field '{field}'").into()),
}
}