diff --git a/src/items.rs b/src/items.rs index a660f287a5b0..7a2d3048ff03 100644 --- a/src/items.rs +++ b/src/items.rs @@ -684,13 +684,15 @@ fn format_impl_ref_and_type( item: &ast::Item, offset: Indent, ) -> Option { - if let ast::ItemKind::Impl(unsafety, - polarity, - _, - ref generics, - ref trait_ref, - ref self_ty, - _) = item.node + if let ast::ItemKind::Impl( + unsafety, + polarity, + _, + ref generics, + ref trait_ref, + ref self_ty, + _, + ) = item.node { let mut result = String::new(); diff --git a/src/types.rs b/src/types.rs index d725b0919831..edeeb1e3b723 100644 --- a/src/types.rs +++ b/src/types.rs @@ -371,11 +371,11 @@ impl Rewrite for ast::WherePredicate { // TODO: dead spans? let result = match *self { ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate { - ref bound_lifetimes, - ref bounded_ty, - ref bounds, - .. - }) => { + ref bound_lifetimes, + ref bounded_ty, + ref bounds, + .. + }) => { let type_str = try_opt!(bounded_ty.rewrite(context, shape)); let colon = type_bound_colon(context); @@ -428,10 +428,10 @@ impl Rewrite for ast::WherePredicate { } } ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate { - ref lifetime, - ref bounds, - .. - }) => { + ref lifetime, + ref bounds, + .. + }) => { try_opt!(rewrite_bounded_lifetime( lifetime, bounds.iter(), @@ -440,10 +440,10 @@ impl Rewrite for ast::WherePredicate { )) } ast::WherePredicate::EqPredicate(ast::WhereEqPredicate { - ref lhs_ty, - ref rhs_ty, - .. - }) => { + ref lhs_ty, + ref rhs_ty, + .. + }) => { let lhs_ty_str = try_opt!(lhs_ty.rewrite(context, shape)); // 3 = " = ".len() let used_width = 3 + lhs_ty_str.len(); diff --git a/src/utils.rs b/src/utils.rs index 0d1b32570c83..c432df301dfd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -99,6 +99,7 @@ pub fn last_line_width(s: &str) -> usize { None => s.len(), } } + #[inline] pub fn trimmed_last_line_width(s: &str) -> usize { match s.rfind('\n') {