fix(autofmt): remove extra whitespace before commas in for-loop tuple patterns (#5384)
* fix(autofmt): remove extra whitespace before commas in for-loop tuple patterns `dx fmt` was adding spaces before commas in for-loop destructuring patterns (e.g. `for (index , name , value)`) because `TokenStream::Display` inserts spaces between every token. Route the pattern through prettyplease via a new `unparse_pat` helper, following the existing `unparse_expr` pattern. Fixes #5348 * style: apply rustfmt to writer.rs --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
fff2e3d5a9
commit
e5b9c39f4e
4 files changed
+49
-5
No files matched your search
@@ -0,0 +1,17 @@
|
||||
rsx! {
|
||||
for (index, name, value) in data.iter() {
|
||||
div { "{index}: {name} = {value}" }
|
||||
}
|
||||
|
||||
for item in items {
|
||||
div { "{item}" }
|
||||
}
|
||||
|
||||
for (a, b) in pairs.iter().enumerate() {
|
||||
span { "{a}-{b}" }
|
||||
}
|
||||
|
||||
for (_, value) in pairs {
|
||||
span { "{value}" }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user