fix: MaybeProp None case

This commit is contained in:
Greg Johnston 2024-07-03 20:55:41 -04:00
parent 8b9bcffbb9
commit 746bf8e453

View file

@ -561,7 +561,10 @@ pub mod read {
&self,
fun: impl FnOnce(&Self::Value) -> U,
) -> Option<U> {
self.0.as_ref().and_then(|n| n.try_with_untracked(fun))
match &self.0 {
None => Some(fun(&None)),
Some(inner) => inner.try_with_untracked(fun),
}
}
}
@ -572,7 +575,10 @@ pub mod read {
&self,
fun: impl FnOnce(&Self::Value) -> U,
) -> Option<U> {
self.0.as_ref().and_then(|n| n.try_with(fun))
match &self.0 {
None => Some(fun(&None)),
Some(inner) => inner.try_with(fun),
}
}
}