fix ref try map

This commit is contained in:
Evan Almloff committed 2023-11-07 09:26:12 -06:00
1 parent e77c158636
commit 2731ca0b30
2 files changed
+2 -2

No files matched your search

+1 -2
View File
@@ -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
View File
@@ -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 = []