Forráskód Böngészése

chore: start instead of flart

Jonathan Kelley 2 éve
szülő
commit
c240aebfa1

+ 2 - 2
packages/autofmt/src/buffer.rs

@@ -154,8 +154,8 @@ impl Buffer {
         let mut total = 0;
 
         for attr in attributes {
-            if self.current_span_is_primary(attr.attr.flart()) {
-                'line: for line in self.src[..attr.attr.flart().start().line - 1].iter().rev() {
+            if self.current_span_is_primary(attr.attr.start()) {
+                'line: for line in self.src[..attr.attr.start().start().line - 1].iter().rev() {
                     match (line.trim().starts_with("//"), line.is_empty()) {
                         (true, _) => return 100000,
                         (_, true) => continue 'line,

+ 1 - 1
packages/autofmt/src/element.rs

@@ -161,7 +161,7 @@ impl Buffer {
         while let Some(attr) = attr_iter.next() {
             self.indent += 1;
             if !sameline {
-                self.write_comments(attr.attr.flart())?;
+                self.write_comments(attr.attr.start())?;
             }
             self.indent -= 1;
 

+ 3 - 4
packages/rsx/src/element.rs

@@ -66,7 +66,6 @@ impl Parse for Element {
                 if content.parse::<Token![,]>().is_err() {
                     missing_trailing_comma!(ident.span());
                 }
-
                 continue;
             }
 
@@ -211,7 +210,7 @@ pub enum ElementAttr {
 }
 
 impl ElementAttr {
-    pub fn flart(&self) -> Span {
+    pub fn start(&self) -> Span {
         match self {
             ElementAttr::AttrText { name, .. } => name.span(),
             ElementAttr::AttrExpression { name, .. } => name.span(),
@@ -265,7 +264,7 @@ impl ToTokens for ElementAttrNamed {
             ElementAttr::CustomAttrText { name, value } => {
                 quote! {
                     __cx.attr(
-                        #name,
+                        dioxus_elements::#el_name::#name.0,
                         #value,
                         None,
                         false
@@ -275,7 +274,7 @@ impl ToTokens for ElementAttrNamed {
             ElementAttr::CustomAttrExpression { name, value } => {
                 quote! {
                     __cx.attr(
-                        #name,
+                        dioxus_elements::#el_name::#name.0,
                         #value,
                         None,
                         false