Closed paul-hansen closed 4 months ago
Using leptosfmt . to format code that has rust code in a {} block inside a view sometimes adds a blank line after the block. It seems to depend on the content of the code block, most commonly noticed in blocks that contain match or if statements.
leptosfmt .
No blank lines added after code blocks
Before
view! { <h2> {match error_code { StatusCode::SERVICE_UNAVAILABLE => "custom error msg".to_string(), error_code => error_code.to_string(), }} </h2> }
After leptosfmt .
Notice the blank line after the double closing brackets.
Tested with 0.1.18 from crates.io and latest main.
What happened
Using
leptosfmt .
to format code that has rust code in a {} block inside a view sometimes adds a blank line after the block. It seems to depend on the content of the code block, most commonly noticed in blocks that contain match or if statements.Expected
No blank lines added after code blocks
Example
Before
After
leptosfmt .
Notice the blank line after the double closing brackets.
Tested with 0.1.18 from crates.io and latest main.