mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
Format source codes
This commit is contained in:
parent
6aed417738
commit
635fdc662a
@ -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();
|
||||
|
||||
|
@ -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))))
|
||||
}
|
||||
|
@ -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))),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user