소스 검색

switch router to `async-lock`

Adrian Wannenmacher 2 년 전
부모
커밋
00174d4f46

+ 1 - 1
packages/router-core/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-async-rwlock = "1.3.0"
+async-lock = "2.7.0"
 either = "1.8.0"
 futures-channel = "0.3.25"
 futures-util = "0.3.25"

+ 1 - 1
packages/router-core/src/service.rs

@@ -4,7 +4,7 @@ use std::{
     sync::{Arc, Weak},
 };
 
-use async_rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
+use async_lock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
 use either::Either;
 use futures_channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
 use futures_util::StreamExt;

+ 1 - 1
packages/router/Cargo.toml

@@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"]
 
 [dependencies]
 anyhow = "1.0.66"
-async-rwlock = "1.3.0"
+async-lock = "2.7.0"
 dioxus = { path="../dioxus" }
 dioxus-router-core = { path = "../router-core"}
 futures-channel = "0.3.25"

+ 1 - 1
packages/router/src/contexts/router.rs

@@ -1,6 +1,6 @@
 use std::sync::Arc;
 
-use async_rwlock::RwLock;
+use async_lock::RwLock;
 use dioxus::{core::Component, prelude::ScopeId};
 use dioxus_router_core::{RouterMessage, RouterState};
 use futures_channel::mpsc::UnboundedSender;

+ 1 - 1
packages/router/src/hooks/use_route.rs

@@ -1,4 +1,4 @@
-use async_rwlock::RwLockReadGuard;
+use async_lock::RwLockReadGuard;
 use dioxus::{core::Component, prelude::ScopeState};
 use dioxus_router_core::RouterState;
 

+ 1 - 1
packages/router/src/hooks/use_router.rs

@@ -1,4 +1,4 @@
-use async_rwlock::RwLockReadGuard;
+use async_lock::RwLockReadGuard;
 use dioxus::{core::Component, prelude::*};
 use dioxus_router_core::{
     history::{HistoryProvider, MemoryHistory},