Format source codes

This commit is contained in:
topecongiro 2017-05-25 09:34:10 +09:00
parent 6aed417738
commit 635fdc662a
3 changed files with 10 additions and 12 deletions

View File

@ -99,11 +99,9 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
}
let trailing_try_num = subexpr_list
.iter()
.take_while(|e| {
match e.node {
ast::ExprKind::Try(..) => true,
_ => false,
}
.take_while(|e| match e.node {
ast::ExprKind::Try(..) => true,
_ => false,
})
.count();

View File

@ -39,10 +39,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))))
}

View File

@ -144,9 +144,9 @@ fn issue470() {
impl Foo {
pub fn bar(&self) {
Some(SomeType {
push_closure_out_to_100_chars: iter(otherwise_it_works_ok.into_iter().map(|f| {
Ok(f)
})),
push_closure_out_to_100_chars: iter(otherwise_it_works_ok
.into_iter()
.map(|f| Ok(f))),
})
}
}