}
}
-macro impl_into_overflowable_item_for_ast_node {
+macro_rules! impl_into_overflowable_item_for_ast_node {
($($ast_node:ident),*) => {
$(
impl<'a> IntoOverflowableItem<'a> for ast::$ast_node {
}
}
-macro impl_into_overflowable_item_for_rustfmt_types {
+macro_rules! impl_into_overflowable_item_for_rustfmt_types {
([$($ty:ident),*], [$($ty_with_lifetime:ident),*]) => {
$(
impl<'a> IntoOverflowableItem<'a> for $ty {
closures::rewrite_last_closure(self.context, expr, shape)
}
}
+
// When overflowing the expressions which consists of a control flow
// expression, avoid condition to use multi line.
ast::ExprKind::If(..)
expr.rewrite(self.context, shape)
}
}
+
_ => expr.rewrite(self.context, shape),
}
}
- item @ _ => item.rewrite(self.context, shape),
+ item => item.rewrite(self.context, shape),
};
if let Some(rewrite) = rewrite {
})
}
-fn can_be_overflowed<'a>(context: &RewriteContext, items: &[OverflowableItem]) -> bool {
+fn can_be_overflowed(context: &RewriteContext, items: &[OverflowableItem]) -> bool {
items
.last()
.map_or(false, |x| x.can_be_overflowed(context, items.len()))