From d677d072fd2af0a22afebb6ee2e0a0c43abab1bc Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Mon, 4 Apr 2022 19:52:44 -0700 Subject: [PATCH] Fixing issues found during publishing These were found in v0.4.0, but apparently I forgot to apply them to main. --- crates/bonsaidb-client/Cargo.toml | 2 +- crates/bonsaidb-keystorage-s3/src/lib.rs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/bonsaidb-client/Cargo.toml b/crates/bonsaidb-client/Cargo.toml index 158b6862492..3ed009ce623 100644 --- a/crates/bonsaidb-client/Cargo.toml +++ b/crates/bonsaidb-client/Cargo.toml @@ -58,7 +58,7 @@ wasm-bindgen = "0.2" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] fabruic = { version = "0.0.1-dev.5" } -tokio = { version = "1.16.1", features = ["sync"] } +tokio = { version = "1.16.1", features = ["macros", "sync"] } tokio-tungstenite = { version = "0.16", optional = true, features = [ "rustls-tls-native-roots", ] } diff --git a/crates/bonsaidb-keystorage-s3/src/lib.rs b/crates/bonsaidb-keystorage-s3/src/lib.rs index 4c9c6fca9be..b224bbf7d50 100644 --- a/crates/bonsaidb-keystorage-s3/src/lib.rs +++ b/crates/bonsaidb-keystorage-s3/src/lib.rs @@ -59,7 +59,7 @@ use bonsaidb_local::{ StorageId, }; pub use http; -use tokio::runtime::{Handle, Runtime}; +use tokio::runtime::{self, Handle, Runtime}; /// S3-compatible [`VaultKeyStorage`] implementor. #[derive(Default, Debug)] @@ -86,7 +86,17 @@ enum Tokio { impl Default for Tokio { fn default() -> Self { - Handle::try_current().map_or_else(|_| Self::Runtime(Runtime::new().unwrap()), Self::Handle) + Handle::try_current().map_or_else( + |_| { + Self::Runtime( + runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(), + ) + }, + Self::Handle, + ) } }