From c704f43c563c6aaa8e198536f0222762019a2323 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Sun, 31 Mar 2024 17:31:38 +0100 Subject: [PATCH] refactor: remove left over blocking --- crates/cashu-sdk/Cargo.toml | 4 +--- crates/cashu-sdk/src/lib.rs | 18 ------------------ 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/crates/cashu-sdk/Cargo.toml b/crates/cashu-sdk/Cargo.toml index 53f38f1e..94cd8206 100644 --- a/crates/cashu-sdk/Cargo.toml +++ b/crates/cashu-sdk/Cargo.toml @@ -12,7 +12,7 @@ license.workspace = true [features] default = ["mint", "wallet", "all-nuts", "redb"] mint = ["cashu/mint"] -wallet = ["cashu/wallet", "dep:minreq", "dep:once_cell"] +wallet = ["cashu/wallet", "dep:minreq"] gloo = ["dep:gloo"] all-nuts = ["nut07", "nut08", "nut09", "nut10", "nut11", "nut12", "nut13"] nut07 = ["cashu/nut07"] @@ -32,8 +32,6 @@ serde = { workspace = true } serde_json = { workspace = true } url = { workspace = true } tracing = { workspace = true } -futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] } -once_cell = { version = "1.17", optional = true } thiserror = { workspace = true } async-trait = "0.1.74" gloo = { version = "0.11.0", optional = true, features = ["net"] } diff --git a/crates/cashu-sdk/src/lib.rs b/crates/cashu-sdk/src/lib.rs index 79083942..fecf307e 100644 --- a/crates/cashu-sdk/src/lib.rs +++ b/crates/cashu-sdk/src/lib.rs @@ -1,13 +1,3 @@ -#[cfg(all(target_arch = "wasm32", feature = "blocking"))] -compile_error!("`blocking` feature can't be enabled for WASM targets"); - -#[cfg(feature = "blocking")] -use futures_util::Future; -#[cfg(feature = "blocking")] -use once_cell::sync::Lazy; -#[cfg(feature = "blocking")] -use tokio::runtime::Runtime; - #[cfg(feature = "wallet")] pub mod client; @@ -19,11 +9,3 @@ pub mod wallet; pub use bip39::Mnemonic; pub use cashu::{self, *}; - -#[cfg(feature = "blocking")] -static RUNTIME: Lazy = Lazy::new(|| Runtime::new().expect("Can't start Tokio runtime")); - -#[cfg(feature = "blocking")] -pub fn block_on(future: F) -> F::Output { - RUNTIME.block_on(future) -}