diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2018-10-12 20:07:25 -0300 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2018-10-12 20:07:25 -0300 |
| commit | b144adf3be09bc31f4d306be9e5992b000fc7b1f (patch) | |
| tree | dc8b1f9eaa6dc4b734a27fe1ad95b5294cb9f56f /src | |
| parent | 8b709c0019244d8554c0799084815146a5ce800a (diff) | |
closures: replace `.unwrap_or` with `.map_or`
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'src')
| -rw-r--r-- | src/closures.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/closures.rs b/src/closures.rs index bde08931d18..fa656cc351e 100644 --- a/src/closures.rs +++ b/src/closures.rs @@ -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); } |
