Jonathan Kelley 2 rokov pred
rodič
commit
5c63ae4b5d
2 zmenil súbory, kde vykonal 1 pridanie a 12 odobranie
  1. 1 1
      packages/autofmt/src/lib.rs
  2. 0 11
      packages/rsx/src/node.rs

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

@@ -118,7 +118,7 @@ pub fn write_block_out(body: CallBody) -> Option<String> {
 }
 
 pub fn fmt_block(block: &str, indent_level: usize) -> Option<String> {
-    let body = syn::parse_str::<dioxus_rsx::CallBody>(block).unwrap();
+    let body = syn::parse_str::<dioxus_rsx::CallBody>(block).ok()?;
 
     let mut buf = Buffer {
         src: block.lines().map(|f| f.to_string()).collect(),

+ 0 - 11
packages/rsx/src/node.rs

@@ -16,17 +16,6 @@ Parse
 -> component()
 -> "text {with_args}"
 -> (0..10).map(|f| rsx!("asd")),  // <--- notice the comma - must be a complete expr
--> // some comment here (no support for slash asterisk comments - those get deleted completely)
-
-
-
-div {
-    // Comment
-    div { // a comment here because it shares the line
-
-    }
-}
-
 */
 #[derive(PartialEq, Eq, Clone, Debug, Hash)]
 pub enum BodyNode {