Skip to content

Commit

Permalink
Replace map+unwrap_or with map_or.
Browse files Browse the repository at this point in the history
  • Loading branch information
olson-sean-k committed Mar 26, 2024
1 parent 62071d5 commit 69bf4c4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/walk/behavior.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ impl DepthBehavior {
) -> Option<Self> {
let lower = match depth {
DepthVariance::Invariant(depth) => depth,
DepthVariance::Variant(bounds) => {
bounds.lower().bounded().map(usize::from).unwrap_or(0)
},
DepthVariance::Variant(bounds) => bounds.lower().bounded().map_or(0, usize::from),
};
let translation = move |depth: Option<usize>| -> Result<Option<usize>, ()> {
depth
Expand Down

0 comments on commit 69bf4c4

Please sign in to comment.