diff --git a/lib/worker/src/lib.rs b/lib/worker/src/lib.rs index ed327a1..2b25bd6 100644 --- a/lib/worker/src/lib.rs +++ b/lib/worker/src/lib.rs @@ -1,6 +1,8 @@ #![feature(async_fn_in_trait)] #![deny(unsafe_code)] +#[cfg(feature = "d1")] +pub use betterworker_d1 as d1; pub use betterworker_macros::{durable_object, event}; #[doc(hidden)] pub use betterworker_sys; @@ -12,8 +14,6 @@ pub use wasm_bindgen; #[doc(hidden)] pub use wasm_bindgen_futures; pub use worker_kv as kv; -#[cfg(feature = "d1")] -pub use betterworker_d1 as d1; pub mod abort; pub mod body; diff --git a/lib/worker/src/queue.rs b/lib/worker/src/queue.rs index 1abc72c..6d5dcb3 100644 --- a/lib/worker/src/queue.rs +++ b/lib/worker/src/queue.rs @@ -111,7 +111,8 @@ where .map_err(WorkerError::from_js_err)? .as_string() .ok_or(WorkerError::InvalidMessageBatch)?; - let value = js_sys::Reflect::get(message, self.0.body_key).map_err(WorkerError::from_js_err)?; + let value = + js_sys::Reflect::get(message, self.0.body_key).map_err(WorkerError::from_js_err)?; let body = serde_wasm_bindgen::from_value(value)?; Ok(Message { diff --git a/lib/worker/src/websocket.rs b/lib/worker/src/websocket.rs index 4681fcc..b3dba55 100644 --- a/lib/worker/src/websocket.rs +++ b/lib/worker/src/websocket.rs @@ -197,7 +197,8 @@ impl WebSocket { let error_closure = self.add_event_handler("error", move |event: web_sys::ErrorEvent| { let error = event.error(); - tx.unbounded_send(Err(WorkerError::from_js_err(error))).unwrap(); + tx.unbounded_send(Err(WorkerError::from_js_err(error))) + .unwrap(); })?; Ok(EventStream {