Skip to content

Commit 73c5bfe

Browse files
committed
Switch from futures-locks to async-lock
1 parent 2456bea commit 73c5bfe

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

crates/matrix-sdk-base/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ default-features = false
5050
features = ["sync", "fs"]
5151

5252
[dev-dependencies]
53-
futures = { version = "0.3.15", default-features = false }
53+
futures = { version = "0.3.15", default-features = false, features = ["executor"] }
5454
http = "0.2.4"
5555
matrix-sdk-test = { version = "0.4.0", path = "../matrix-sdk-test" }
5656

crates/matrix-sdk-common/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ version = "0.1.9"
3333
features = ["now"]
3434

3535
[target.'cfg(target_arch = "wasm32")'.dependencies]
36-
futures-util = { version = "0.3.15", default-features = false }
37-
futures-locks = { version = "0.6.0", default-features = false }
36+
async-lock = "2.4.0"
37+
futures-util = { version = "0.3.15", default-features = false, features = ["channel"] }
3838
wasm-bindgen-futures = "0.4.24"
3939
uuid = { version = "0.8.2", default-features = false, features = ["v4", "wasm-bindgen"] }

crates/matrix-sdk-common/src/locks.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// could switch to futures-lock completely at some point, blocker:
2-
// https://github.com/asomers/futures-locks/issues/34
3-
// https://www.reddit.com/r/rust/comments/f4zldz/i_audited_3_different_implementation_of_async/
4-
51
#[cfg(target_arch = "wasm32")]
6-
pub use futures_locks::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
2+
pub use async_lock::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
73
#[cfg(not(target_arch = "wasm32"))]
84
pub use tokio::sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};

crates/matrix-sdk-crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ criterion = { version = "0.3.4", features = [
5656
"async_tokio",
5757
"html_reports",
5858
] }
59-
futures = { version = "0.3.15", default-features = false }
59+
futures = { version = "0.3.15", default-features = false, features = ["executor"] }
6060
http = "0.2.4"
6161
indoc = "1.0.3"
6262
matches = "0.1.8"

crates/matrix-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ features = ["wasm-bindgen"]
108108
[dev-dependencies]
109109
anyhow = "1.0"
110110
dirs = "3.0.2"
111-
futures = { version = "0.3.15", default-features = false }
111+
futures = { version = "0.3.15", default-features = false, features = ["executor"] }
112112
lazy_static = "1.4.0"
113113
matches = "0.1.8"
114114
matrix-sdk-test = { version = "0.4.0", path = "../matrix-sdk-test" }

0 commit comments

Comments
 (0)