From 5fff060f4b9231229b853f9e07b0d43b6589b824 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Mon, 13 Nov 2023 15:29:37 +0100 Subject: [PATCH] remove sqlx from wasm-exclusion, add futures-timer --- Cargo.lock | 24 ++++++++++++++++++++++++ Cargo.toml | 27 +++++++++++++++------------ 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15c0a36..995aba4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,6 +197,7 @@ dependencies = [ "chorus-macros", "chrono", "custom_error", + "futures-timer", "futures-util", "getrandom", "hostname", @@ -623,6 +624,12 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.29" @@ -756,6 +763,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + [[package]] name = "hex" version = "0.4.3" @@ -1196,6 +1209,16 @@ dependencies = [ "libm", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + [[package]] name = "object" version = "0.32.1" @@ -2316,6 +2339,7 @@ dependencies = [ "bytes", "libc", "mio", + "num_cpus", "pin-project-lite", "socket2 0.5.5", "tokio-macros", diff --git a/Cargo.toml b/Cargo.toml index 1c831eb..9198461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,10 @@ website = ["https://discord.com/invite/m3FpcapGDD"] [features] -default = ["client"] +default = ["client", "rt-multi-thread"] backend = ["dep:poem", "dep:sqlx"] +rt-multi-thread = ["tokio/rt-multi-thread"] +rt = ["tokio/rt"] client = [] [dependencies] @@ -38,17 +40,6 @@ jsonwebtoken = "8.3.0" log = "0.4.20" async-trait = "0.1.73" chorus-macros = "0.2.0" - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -rustls = "0.21.8" -rustls-native-certs = "0.6.3" -rand = "0.8.5" -hostname = "0.3.1" -tokio-tungstenite = { version = "0.20.0", features = [ - "rustls-tls-native-roots", - "rustls-native-certs", -] } -native-tls = "0.2.11" sqlx = { version = "0.7.1", features = [ "mysql", "sqlite", @@ -58,6 +49,18 @@ sqlx = { version = "0.7.1", features = [ "runtime-tokio-native-tls", "any", ], optional = true } +futures-timer = "3.0.2" + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +rustls = "0.21.8" +rustls-native-certs = "0.6.3" +rand = "0.8.5" +tokio-tungstenite = { version = "0.20.0", features = [ + "rustls-tls-native-roots", + "rustls-native-certs", +] } +native-tls = "0.2.11" +hostname = "0.3.1" [target.'cfg(target_arch = "wasm32")'.dependencies] ws_stream_wasm = "0.7.4"