Closed gitmalong closed 1 year ago
when I try to format the above snippet, it works fine for me?
The following test passes:
#[test]
fn github_issue_71() {
let source = indoc! {r#"
fn main() {
view! { cx,
{move || {
if var().len() > 0 {
view! { cx,
<p></p>
}
.into_view(cx)
} else {
().into_view(cx)
}
}}
}
}
"#};
let result = format_file_source(
source,
FormatterSettings {
max_width: 60,
..Default::default()
},
)
.unwrap();
insta::assert_snapshot!(result, @r###"
fn main() {
view! { cx,
{move || {
if var().len() > 0 {
view! { cx, <p></p> }.into_view(cx)
} else {
().into_view(cx)
}
}}
}
}
"###);
}
also could not parse file
indicates that your rust code was not parsable. Please make sure that your code compiles before running the formatter if this error occurs. I guess that you have a syntax error somewhere.
Closing this issue, but feel free te reopen if you still think that this is a leptosfmt bug.