1
Fork 0

fix for #355 and test cases

This commit is contained in:
Scyptnex 2015-09-24 12:01:48 +10:00
parent e176dc97fe
commit f1dfab5a29
3 changed files with 113 additions and 1 deletions

View file

@ -151,7 +151,11 @@ impl Rewrite for ast::Expr {
rewrite_chain(self, context, width, offset)
}
ast::Expr_::ExprMac(ref mac) => {
rewrite_macro(mac, context, width, offset)
// Failure to rewrite a marco should not imply failure to rewrite the Expr
rewrite_macro(mac, context, width, offset).or(wrap_str(context.snippet(self.span),
context.config.max_width,
width,
offset))
}
// We do not format these expressions yet, but they should still
// satisfy our width restrictions.