diff --git a/src/attr.rs b/src/attr.rs index a1f5de37c554..498d6e4d8511 100644 --- a/src/attr.rs +++ b/src/attr.rs @@ -37,7 +37,10 @@ pub(crate) fn get_span_without_attrs(stmt: &ast::Stmt) -> Span { } /// Returns attributes that are within `outer_span`. -pub(crate) fn filter_inline_attrs(attrs: &[ast::Attribute], outer_span: Span) -> Vec { +pub(crate) fn filter_inline_attrs( + attrs: &[ast::Attribute], + outer_span: Span, +) -> Vec { attrs .iter() .filter(|a| outer_span.lo() <= a.span.lo() && a.span.hi() <= outer_span.hi()) diff --git a/src/types.rs b/src/types.rs index 3b548b0fb8d3..eb90a67d0dc1 100644 --- a/src/types.rs +++ b/src/types.rs @@ -827,7 +827,11 @@ fn join_bounds( Some(result) } -pub(crate) fn can_be_overflowed_type(context: &RewriteContext<'_>, ty: &ast::Ty, len: usize) -> bool { +pub(crate) fn can_be_overflowed_type( + context: &RewriteContext<'_>, + ty: &ast::Ty, + len: usize, +) -> bool { match ty.node { ast::TyKind::Tup(..) => context.use_block_indent() && len == 1, ast::TyKind::Rptr(_, ref mutty) | ast::TyKind::Ptr(ref mutty) => { diff --git a/src/utils.rs b/src/utils.rs index 4576ca8c5bf2..9a0a29dc5c34 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -54,7 +54,10 @@ pub(crate) fn is_same_visibility(a: &Visibility, b: &Visibility) -> bool { } // Uses Cow to avoid allocating in the common cases. -pub(crate) fn format_visibility(context: &RewriteContext<'_>, vis: &Visibility) -> Cow<'static, str> { +pub(crate) fn format_visibility( + context: &RewriteContext<'_>, + vis: &Visibility, +) -> Cow<'static, str> { match vis.node { VisibilityKind::Public => Cow::from("pub "), VisibilityKind::Inherited => Cow::from(""), @@ -143,7 +146,10 @@ pub(crate) fn ptr_vec_to_ref_vec(vec: &[ptr::P]) -> Vec<&T> { } #[inline] -pub(crate) fn filter_attributes(attrs: &[ast::Attribute], style: ast::AttrStyle) -> Vec { +pub(crate) fn filter_attributes( + attrs: &[ast::Attribute], + style: ast::AttrStyle, +) -> Vec { attrs .iter() .filter(|a| a.style == style) @@ -503,7 +509,11 @@ pub(crate) fn remove_trailing_white_spaces(text: &str) -> String { /// ), /// } /// ``` -pub(crate) fn trim_left_preserve_layout(orig: &str, indent: Indent, config: &Config) -> Option { +pub(crate) fn trim_left_preserve_layout( + orig: &str, + indent: Indent, + config: &Config, +) -> Option { let mut lines = LineClasses::new(orig); let first_line = lines.next().map(|(_, s)| s.trim_end().to_owned())?; let mut trimmed_lines = Vec::with_capacity(16);