Skip to content

Commit

Permalink
fix: MaybeProp None case
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Jul 4, 2024
1 parent 7b51041 commit e873a67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions reactive_graph/src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
}

Expand All @@ -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),
}
}
}

Expand Down

0 comments on commit e873a67

Please sign in to comment.