Skip to content

Commit 59ddb66

Browse files
committed
Fix lints: rustfmt import order, doc link, gate handler wire tests
- rustfmt: reorder the split `use` statements in http.rs/rng.rs/rt.rs. - cargo doc: fix a pre-existing broken intra-doc link in HttpClient::send (`http::request::Builder::extension`), newly surfaced now that the outgoing HTTP client is documented in the default (non-unstable) build. - clippy: gate the request_from_wire/response_into_wire test module behind `unstable`, since those functions are now gated.
1 parent d5e19a7 commit 59ddb66

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

crates/bindings/src/http.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
use crate::rt::{read_bytes_source_as, read_bytes_source_into};
99
use crate::IterBuf;
1010
// Imports used only by the (still-unstable) HTTP handler machinery.
11-
#[cfg(feature = "unstable")]
12-
use crate::{try_with_tx, with_tx, Timestamp, TxContext};
1311
#[cfg(all(feature = "unstable", feature = "rand08"))]
1412
use crate::StdbRng;
13+
#[cfg(feature = "unstable")]
14+
use crate::{try_with_tx, with_tx, Timestamp, TxContext};
1515
use bytes::Bytes;
1616
#[cfg(all(feature = "rand", feature = "unstable"))]
1717
use rand08::RngCore;
@@ -20,11 +20,11 @@ use spacetimedb_lib::db::raw_def::v10::MethodOrAny;
2020
use spacetimedb_lib::http as st_http;
2121
#[cfg(feature = "unstable")]
2222
use spacetimedb_lib::http::{character_is_acceptable_for_route_path, ACCEPTABLE_ROUTE_PATH_CHARS_HUMAN_DESCRIPTION};
23-
use spacetimedb_lib::{bsatn, TimeDuration};
2423
#[cfg(feature = "unstable")]
2524
use spacetimedb_lib::Identity;
2625
#[cfg(all(feature = "unstable", feature = "rand"))]
2726
use spacetimedb_lib::Uuid;
27+
use spacetimedb_lib::{bsatn, TimeDuration};
2828
#[cfg(all(feature = "unstable", feature = "rand"))]
2929
use std::cell::Cell;
3030
#[cfg(all(feature = "unstable", feature = "rand08"))]
@@ -432,7 +432,7 @@ impl HttpClient {
432432
///
433433
/// For simple `GET` requests with no headers, use [`HttpClient::get`] instead.
434434
///
435-
/// Include a [`Timeout`] in the [`Request::extensions`] via [`http::request::RequestBuilder::extension`]
435+
/// Include a [`Timeout`] in the [`Request::extensions`] via [`http::request::Builder::extension`]
436436
/// to impose a timeout on the request.
437437
/// All HTTP requests in SpacetimeDB are subject to a maximum timeout of 500 milliseconds.
438438
/// All other extensions in `request` are ignored.
@@ -810,7 +810,7 @@ impl From<http::Error> for Error {
810810
}
811811
}
812812

813-
#[cfg(test)]
813+
#[cfg(all(test, feature = "unstable"))]
814814
mod tests {
815815
use super::*;
816816

crates/bindings/src/rng.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use crate::ProcedureContext;
21
#[cfg(feature = "unstable")]
32
use crate::http::HandlerContext;
3+
use crate::ProcedureContext;
44
use crate::{rand, ReducerContext};
55
use core::cell::UnsafeCell;
66
use core::marker::PhantomData;

crates/bindings/src/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ use std::marker::PhantomData;
2121
use std::sync::{Mutex, OnceLock};
2222
pub use sys::raw::{BytesSink, BytesSource};
2323

24-
use crate::{ProcedureContext, ProcedureResult};
2524
#[cfg(feature = "unstable")]
2625
use crate::http::{self, HandlerContext};
26+
use crate::{ProcedureContext, ProcedureResult};
2727

2828
pub trait IntoVec<T> {
2929
fn into_vec(self) -> Vec<T>;

0 commit comments

Comments
 (0)