Przeglądaj źródła

fix: Element must be of lowercase letters only

Muhannad Alrusayni 3 lat temu
rodzic
commit
37f7fe2ac6
1 zmienionych plików z 2 dodań i 8 usunięć
  1. 2 8
      packages/core-macro/src/rsx/node.rs

+ 2 - 8
packages/core-macro/src/rsx/node.rs

@@ -33,19 +33,13 @@ impl Parse for BodyNode {
             // this is an Element if path match of:
             // - one ident
             // - followed by `{`
-            // - have no `PathArguments`
-            // - starts with lowercase
+            // - all chars lowercase
             //
             // example:
             // div {}
             if let Some(ident) = path.get_ident() {
                 if body_stream.peek(token::Brace)
-                    && ident
-                        .to_string()
-                        .chars()
-                        .next()
-                        .unwrap()
-                        .is_ascii_lowercase()
+                    && ident.to_string().chars().all(char::is_lowercase)
                 {
                     return Ok(BodyNode::Element(stream.parse::<Element>()?));
                 }