Prevent inclusion of whitespace character after macro_rules ident

This commit is contained in:
Guillaume Gomez 2024-02-27 17:39:32 +01:00
parent 53ed660d47
commit 5df9593f1a

View file

@ -136,6 +136,7 @@ fn can_merge(class1: Option<Class>, class2: Option<Class>, text: &str) -> bool {
match (class1, class2) {
(Some(c1), Some(c2)) => c1.is_equal_to(c2),
(Some(Class::Ident(_)), None) | (None, Some(Class::Ident(_))) => true,
(Some(Class::Macro(_)), _) => false,
(Some(_), None) | (None, Some(_)) => text.trim().is_empty(),
(None, None) => true,
}