diff options
| author | topecongiro <seuchida@gmail.com> | 2017-10-18 22:01:59 +0900 |
|---|---|---|
| committer | topecongiro <seuchida@gmail.com> | 2017-10-18 22:23:25 +0900 |
| commit | 0d359eacd7973e435e27aff8f22d612a69c2e7d0 (patch) | |
| tree | c17695f4a18b5f413354b3350f64f8c1887c7f0c | |
| parent | 142fc45dbb7735be66ebce9efa88df80b8165175 (diff) | |
Cargo fmt
| -rw-r--r-- | src/expr.rs | 4 | ||||
| -rw-r--r-- | src/items.rs | 24 | ||||
| -rw-r--r-- | src/string.rs | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/expr.rs b/src/expr.rs index 8bef270cf76..4eaf52681ad 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1871,7 +1871,9 @@ fn rewrite_pat_expr( } else { format!("{} ", matcher) }; - let pat_shape = shape.offset_left(matcher.len())?.sub_width(connector.len())?; + let pat_shape = shape + .offset_left(matcher.len())? + .sub_width(connector.len())?; let pat_string = pat.rewrite(context, pat_shape)?; let result = format!("{}{}{}", matcher, pat_string, connector); return rewrite_assign_rhs(context, result, expr, shape); diff --git a/src/items.rs b/src/items.rs index be22db49fbf..e2a07194f2b 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2037,9 +2037,7 @@ fn rewrite_args( generics_str_contains_newline: bool, ) -> Option<String> { let mut arg_item_strs = args.iter() - .map(|arg| { - arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent)) - }) + .map(|arg| arg.rewrite(context, Shape::legacy(multi_line_budget, arg_indent))) .collect::<Option<Vec<_>>>()?; // Account for sugary self. @@ -2713,17 +2711,15 @@ impl Rewrite for ast::ForeignItem { let span = mk_sp(self.span.lo(), self.span.hi() - BytePos(1)); let item_str = match self.node { - ast::ForeignItemKind::Fn(ref fn_decl, ref generics) => { - rewrite_fn_base( - context, - shape.indent, - self.ident, - &FnSig::new(fn_decl, generics, self.vis.clone()), - span, - false, - false, - ).map(|(s, _)| format!("{};", s)) - } + ast::ForeignItemKind::Fn(ref fn_decl, ref generics) => rewrite_fn_base( + context, + shape.indent, + self.ident, + &FnSig::new(fn_decl, generics, self.vis.clone()), + span, + false, + false, + ).map(|(s, _)| format!("{};", s)), ast::ForeignItemKind::Static(ref ty, is_mutable) => { // FIXME(#21): we're dropping potential comments in between the // function keywords here. diff --git a/src/string.rs b/src/string.rs index c072d3186a2..9812b8af611 100644 --- a/src/string.rs +++ b/src/string.rs @@ -67,7 +67,9 @@ pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option<String> let ender_length = fmt.line_end.len(); // If we cannot put at least a single character per line, the rewrite won't // succeed. - let max_chars = shape.width.checked_sub(fmt.opener.len() + ender_length + 1)? + 1; + let max_chars = shape + .width + .checked_sub(fmt.opener.len() + ender_length + 1)? + 1; // Snip a line at a time from `orig` until it is used up. Push the snippet // onto result. |
