Skip to content

Commit ac8ceb3

Browse files
committed
fmt, clippy
1 parent 5c1cd43 commit ac8ceb3

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

crates/bindings-sys/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,10 @@ pub mod raw {
681681
/// Returns an error:
682682
///
683683
/// - `WOULD_BLOCK_TRANSACTION` if there is currently a transaction open.
684-
/// In this case, `out` is not written.
684+
/// In this case, `out` is not written.
685685
/// - `HTTP_ERROR` if an error occurs while executing the HTTP request.
686-
/// In this case, a [`BytesSource`] is written to `out`
687-
/// containing a BSATN-encoded `spacetimedb_lib::http::Error` object.
686+
/// In this case, a [`BytesSource`] is written to `out`
687+
/// containing a BSATN-encoded `spacetimedb_lib::http::Error` object.
688688
///
689689
/// # Traps
690690
///

crates/core/src/host/wasmtime/wasm_instance_env.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,10 +1456,10 @@ impl WasmInstanceEnv {
14561456
/// Returns an error:
14571457
///
14581458
/// - `WOULD_BLOCK_TRANSACTION` if there is currently a transaction open.
1459-
/// In this case, `out` is not written.
1459+
/// In this case, `out` is not written.
14601460
/// - `HTTP_ERROR` if an error occurs while executing the HTTP request.
1461-
/// In this case, a [`BytesSource`] is written to `out`
1462-
/// containing a BSATN-encoded `spacetimedb_lib::http::Error` object.
1461+
/// In this case, a [`BytesSource`] is written to `out`
1462+
/// containing a BSATN-encoded `spacetimedb_lib::http::Error` object.
14631463
///
14641464
/// # Traps
14651465
///
@@ -1477,6 +1477,9 @@ impl WasmInstanceEnv {
14771477
Self::async_with_span(caller, AbiCall::ProcedureHttpRequest, move |mut caller| async move {
14781478
let (mem, env) = Self::mem_env(&mut caller);
14791479

1480+
// Yes clippy, I'm calling a closure at its definition site *on purpose*,
1481+
// as a hacky-but-stable `try` block.
1482+
#[allow(clippy::redundant_closure_call)]
14801483
let res = (async move || {
14811484
if env.instance_env.in_tx() {
14821485
// If we're holding a transaction open, refuse to perform this blocking operation.
@@ -1611,7 +1614,7 @@ impl WasmInstanceEnv {
16111614
let response = st_http::Response::from(response);
16121615

16131616
// Write the request across the WASM boundary.
1614-
return write_result(
1617+
write_result(
16151618
&response,
16161619
0u32,
16171620
// If serializing the response fails (which I'm not sure it can, but the types allow it to),
@@ -1620,7 +1623,7 @@ impl WasmInstanceEnv {
16201623
mem,
16211624
out,
16221625
env,
1623-
);
1626+
)
16241627
})()
16251628
.await;
16261629

crates/lib/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ pub mod db;
1111
mod direct_index_key;
1212
pub mod error;
1313
mod filterable_value;
14+
pub mod http;
1415
pub mod identity;
1516
pub mod metrics;
1617
pub mod operator;
1718
pub mod query;
1819
pub mod scheduler;
1920
pub mod st_var;
2021
pub mod version;
21-
pub mod http;
2222

2323
pub mod type_def {
2424
pub use spacetimedb_sats::{AlgebraicType, ProductType, ProductTypeElement, SumType};

0 commit comments

Comments
 (0)