Reformatting after rebase

This commit is contained in:
Nick Cameron 2018-07-24 15:48:23 +12:00
parent dcf9f61635
commit df4fb8a05b
6 changed files with 27 additions and 27 deletions

View File

@ -302,7 +302,7 @@ trait ChainFormatter {
// foo.bar
// .baz()
// ```
// If `bar` were not part of the root, then baz would be orphaned and 'float'.
// If `bar` were not part of the root, then foo would be orphaned and 'float'.
fn format_root(
&mut self,
parent: &ChainItem,

View File

@ -376,7 +376,8 @@ where
ast::ExprKind::Closure(..) => true,
_ => false,
}).unwrap_or(false)
}).count() > 1
}).count()
> 1
}
fn is_block_closure_forced(context: &RewriteContext, expr: &ast::Expr) -> bool {

View File

@ -246,8 +246,7 @@ impl FormattingError {
fl.file
.get_line(fl.lines[0].line_index)
.map(|l| l.into_owned())
})
.unwrap_or_else(|| String::new()),
}).unwrap_or_else(|| String::new()),
}
}

View File

@ -1118,15 +1118,14 @@ fn indent_macro_snippet(
}).min()?;
Some(
first_line + "\n"
+ &trimmed_lines
first_line + "\n" + &trimmed_lines
.iter()
.map(
|&(trimmed, ref line, prefix_space_width)| match prefix_space_width {
_ if !trimmed => line.to_owned(),
Some(original_indent_width) => {
let new_indent_width = indent.width()
+ original_indent_width.saturating_sub(min_prefix_space_width);
let new_indent_width = indent.width() + original_indent_width
.saturating_sub(min_prefix_space_width);
let new_indent = Indent::from_width(context.config, new_indent_width);
format!("{}{}", new_indent.to_string(context.config), line.trim())
}

View File

@ -241,7 +241,8 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
let item_length = items
.iter()
.take_while(|ppi| {
item_kind.is_same_item_kind(&***ppi) && (!in_group || {
item_kind.is_same_item_kind(&***ppi)
&& (!in_group || {
let current = self.codemap.lookup_line_range(ppi.span());
let in_same_group = current.lo < last.hi + 2;
last = current;