chore: dont panic

This commit is contained in:
Jonathan Kelley 2022-12-29 01:02:07 -05:00
parent ecb154db6f
commit 5c63ae4b5d
2 changed files with 1 additions and 12 deletions

View file

@ -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(),

View file

@ -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 {