From 44dc4c442530e6880fd70d021077a379761d2ecd Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 25 Mar 2022 17:59:26 -0700 Subject: [PATCH] Improve spacing of nested macro calls --- src/mac.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mac.rs b/src/mac.rs index 5f57216..9c4c119 100644 --- a/src/mac.rs +++ b/src/mac.rs @@ -141,6 +141,7 @@ impl Printer { Colon, Colon2, Ident, + IdentBang, Delim, Other, } @@ -166,6 +167,10 @@ impl Printer { (Ident, Token::Group(Delimiter::Parenthesis | Delimiter::Bracket, _)) => { (false, Delim) } + (Ident, Token::Punct('!', Spacing::Alone)) => (false, IdentBang), + (IdentBang, Token::Group(Delimiter::Parenthesis | Delimiter::Bracket, _)) => { + (false, Other) + } (Colon, Token::Punct(':', _)) => (false, Colon2), (_, Token::Group(Delimiter::Parenthesis | Delimiter::Bracket, _)) => (true, Delim), (_, Token::Group(Delimiter::Brace | Delimiter::None, _)) => (true, Other),