diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2017-03-07 09:40:08 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2017-03-07 09:50:41 +1300 |
| commit | 33b83ae7dfb7f20825f666ecc78d5f7ad97597b1 (patch) | |
| tree | 37ed503dd63170b039d608398315730d4e942b10 /src/patterns.rs | |
| parent | c7a33062e25e1d80545ae6094d3faa99348c79e1 (diff) | |
Formatting fallout
Also fixes a minor bug when we break a line after `if` and used to leave a trailing space
Diffstat (limited to 'src/patterns.rs')
| -rw-r--r-- | src/patterns.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/patterns.rs b/src/patterns.rs index cbaa29a4569..601506b4954 100644 --- a/src/patterns.rs +++ b/src/patterns.rs @@ -36,10 +36,10 @@ impl Rewrite for Pat { let sub_pat = match *sub_pat { Some(ref p) => { // 3 - ` @ `. - let width = try_opt!(shape.width - .checked_sub(prefix.len() + mut_infix.len() + - id_str.len() + - 3)); + let width = try_opt!(shape.width.checked_sub(prefix.len() + + mut_infix.len() + + id_str.len() + + 3)); format!(" @ {}", try_opt!(p.rewrite(context, Shape::legacy(width, shape.indent)))) } @@ -90,15 +90,15 @@ impl Rewrite for Pat { PatKind::Slice(ref prefix, ref slice_pat, ref suffix) => { // Rewrite all the sub-patterns. let prefix = prefix.iter().map(|p| p.rewrite(context, shape)); - let slice_pat = - slice_pat.as_ref() - .map(|p| Some(format!("{}..", try_opt!(p.rewrite(context, shape))))); + let slice_pat = slice_pat.as_ref().map(|p| { + Some(format!("{}..", + try_opt!(p.rewrite(context, shape)))) + }); let suffix = suffix.iter().map(|p| p.rewrite(context, shape)); // Munge them together. - let pats: Option<Vec<String>> = prefix.chain(slice_pat.into_iter()) - .chain(suffix) - .collect(); + let pats: Option<Vec<String>> = + prefix.chain(slice_pat.into_iter()).chain(suffix).collect(); // Check that all the rewrites succeeded, and if not return None. let pats = try_opt!(pats); |
