Skip to content

Commit

Permalink
Fixing issues found during publishing
Browse files Browse the repository at this point in the history
These were found in v0.4.0, but apparently I forgot to apply them to main.
  • Loading branch information
ecton committed Apr 5, 2022
1 parent 500b0a0 commit d677d07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bonsaidb-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
] }
Expand Down
14 changes: 12 additions & 2 deletions crates/bonsaidb-keystorage-s3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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,
)
}
}

Expand Down

0 comments on commit d677d07

Please sign in to comment.