diff options
| author | topecongiro <seuchida@gmail.com> | 2017-05-19 19:31:29 +0900 |
|---|---|---|
| committer | topecongiro <seuchida@gmail.com> | 2017-05-23 11:37:33 +0900 |
| commit | 77a2e9858b44598454aa6240475255cd5547d519 (patch) | |
| tree | 254e585d3202349e1a0bacf57eb94fd8da5843e2 /src/types.rs | |
| parent | f2ec5a7bac3f8bdda148307c576f41f2ca005828 (diff) | |
Format source codes
Diffstat (limited to 'src/types.rs')
| -rw-r--r-- | src/types.rs | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/types.rs b/src/types.rs index ffa9639005a..570755d4441 100644 --- a/src/types.rs +++ b/src/types.rs @@ -364,7 +364,9 @@ impl Rewrite for ast::WherePredicate { let colon = type_bound_colon(context); if !bound_lifetimes.is_empty() { - let lifetime_str: String = try_opt!(bound_lifetimes.iter() + let lifetime_str: String = + try_opt!(bound_lifetimes + .iter() .map(|lt| lt.rewrite(context, shape)) .intersperse(Some(", ".to_string())) .collect()); @@ -376,14 +378,17 @@ impl Rewrite for ast::WherePredicate { // 6 = "for<> ".len() let used_width = lifetime_str.len() + type_str.len() + colon.len() + 6; let budget = try_opt!(shape.width.checked_sub(used_width)); - let bounds_str: String = try_opt!(bounds.iter() - .map(|ty_bound| { - ty_bound.rewrite(context, - Shape::legacy(budget, - shape.indent + used_width)) - }) - .intersperse(Some(joiner.to_string())) - .collect()); + let bounds_str: String = + try_opt!(bounds + .iter() + .map(|ty_bound| { + ty_bound.rewrite(context, + Shape::legacy(budget, + shape.indent + + used_width)) + }) + .intersperse(Some(joiner.to_string())) + .collect()); if context.config.spaces_within_angle_brackets() && lifetime_str.len() > 0 { format!("for< {} > {}{}{}", @@ -401,14 +406,17 @@ impl Rewrite for ast::WherePredicate { }; let used_width = type_str.len() + colon.len(); let budget = try_opt!(shape.width.checked_sub(used_width)); - let bounds_str: String = try_opt!(bounds.iter() - .map(|ty_bound| { - ty_bound.rewrite(context, - Shape::legacy(budget, - shape.indent + used_width)) - }) - .intersperse(Some(joiner.to_string())) - .collect()); + let bounds_str: String = + try_opt!(bounds + .iter() + .map(|ty_bound| { + ty_bound.rewrite(context, + Shape::legacy(budget, + shape.indent + + used_width)) + }) + .intersperse(Some(joiner.to_string())) + .collect()); format!("{}{}{}", type_str, colon, bounds_str) } |
