Jelajahi Sumber

fix ref try map

Evan Almloff 1 tahun lalu
induk
melakukan
2731ca0b30
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 1 2
      packages/generational-box/src/lib.rs
  2. 1 0
      packages/signals/Cargo.toml

+ 1 - 2
packages/generational-box/src/lib.rs

@@ -9,7 +9,6 @@ use std::{
     fmt::Debug,
     fmt::Debug,
     marker::PhantomData,
     marker::PhantomData,
     ops::{Deref, DerefMut},
     ops::{Deref, DerefMut},
-    rc::Rc,
     sync::{atomic::AtomicU32, Arc, OnceLock},
     sync::{atomic::AtomicU32, Arc, OnceLock},
 };
 };
 
 
@@ -300,7 +299,7 @@ impl<T> Mappable<T> for Ref<'static, T> {
         _self: Self,
         _self: Self,
         f: impl FnOnce(&T) -> Option<&U>,
         f: impl FnOnce(&T) -> Option<&U>,
     ) -> Option<Self::Mapped<U>> {
     ) -> Option<Self::Mapped<U>> {
-        Ref::try_map(_self, f)
+        Ref::filter_map(_self, f).ok()
     }
     }
 }
 }
 
 

+ 1 - 0
packages/signals/Cargo.toml

@@ -22,6 +22,7 @@ futures-util.workspace = true
 dioxus = { workspace = true }
 dioxus = { workspace = true }
 dioxus-desktop = { workspace = true }
 dioxus-desktop = { workspace = true }
 tokio = { version = "1", features = ["full"] }
 tokio = { version = "1", features = ["full"] }
+tracing-subscriber = "0.3.17"
 
 
 [features]
 [features]
 default = []
 default = []