Explorar o código

Merge pull request #1420 from ealmloff/only-collect-rsx-macro

Only collect the rsx and render macros in autofmt
Jonathan Kelley hai 1 ano
pai
achega
e799c2efa2
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      packages/autofmt/src/collect_macros.rs

+ 9 - 1
packages/autofmt/src/collect_macros.rs

@@ -17,7 +17,15 @@ struct MacroCollector<'a, 'b> {
 
 impl<'a, 'b> Visit<'b> for MacroCollector<'a, 'b> {
     fn visit_macro(&mut self, i: &'b Macro) {
-        self.macros.push(i);
+        if let Some("rsx" | "render") = i
+            .path
+            .segments
+            .last()
+            .map(|i| i.ident.to_string())
+            .as_deref()
+        {
+            self.macros.push(i)
+        }
     }
 }