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

Commit b144adf

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/closures.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ pub fn rewrite_last_closure(
345345

346346
// When overflowing the closure which consists of a single control flow expression,
347347
// force to use block if its condition uses multi line.
348-
let is_multi_lined_cond = rewrite_cond(context, body, body_shape)
349-
.map(|cond| cond.contains('\n') || cond.len() > body_shape.width)
350-
.unwrap_or(false);
348+
let is_multi_lined_cond = rewrite_cond(context, body, body_shape).map_or(false, |cond| {
349+
cond.contains('\n') || cond.len() > body_shape.width
350+
});
351351
if is_multi_lined_cond {
352352
return rewrite_closure_with_block(body, &prefix, context, body_shape);
353353
}

0 commit comments

Comments
 (0)