]> git.lizzy.rs Git - rust.git/blobdiff - src/closures.rs
Fixup formatting
[rust.git] / src / closures.rs
index bde08931d18e0aae2d93fbd6cdff86d87ddda19e..fa656cc351eea68c857d6bbe8ce99cdd3acaa384 100644 (file)
@@ -345,9 +345,9 @@ pub fn rewrite_last_closure(
 
         // When overflowing the closure which consists of a single control flow expression,
         // force to use block if its condition uses multi line.
-        let is_multi_lined_cond = rewrite_cond(context, body, body_shape)
-            .map(|cond| cond.contains('\n') || cond.len() > body_shape.width)
-            .unwrap_or(false);
+        let is_multi_lined_cond = rewrite_cond(context, body, body_shape).map_or(false, |cond| {
+            cond.contains('\n') || cond.len() > body_shape.width
+        });
         if is_multi_lined_cond {
             return rewrite_closure_with_block(body, &prefix, context, body_shape);
         }