Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2e9a97a

Browse files
committed
expr: replace .unwrap_or with .map_or
Signed-off-by: Otavio Salvador <[email protected]>
1 parent b144adf commit 2e9a97a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/expr.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,9 @@ pub fn format_expr(
273273

274274
format!(
275275
"{}{}{}",
276-
lhs.map(|lhs| space_if(needs_space_before_range(context, lhs)))
277-
.unwrap_or(""),
276+
lhs.map_or("", |lhs| space_if(needs_space_before_range(context, lhs))),
278277
delim,
279-
rhs.map(|rhs| space_if(needs_space_after_range(rhs)))
280-
.unwrap_or(""),
278+
rhs.map_or("", |rhs| space_if(needs_space_after_range(rhs))),
281279
)
282280
};
283281

0 commit comments

Comments
 (0)