Commit 404f749
committed
Fix shorthand field pat for destructure_tuple_binding
Example
---
```rust
struct S { field: (i32, i32) }
fn main() {
let S { $0field } = S { field: (2, 3) };
let v = field.0 + field.1;
}
```
**Before this PR**:
```rust
struct S { field: (i32, i32) }
fn main() {
let S { ($0_0, _1) } = S { field: (2, 3) };
let v = _0 + _1;
}
```
**After this PR**:
```rust
struct S { field: (i32, i32) }
fn main() {
let S { field: ($0_0, _1) } = S { field: (2, 3) };
let v = _0 + _1;
}
```1 parent 3810e17 commit 404f749
File tree
1 file changed
+53
-1
lines changed- src/tools/rust-analyzer/crates/ide-assists/src/handlers
1 file changed
+53
-1
lines changedLines changed: 53 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
| |||
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
193 | | - | |
| 199 | + | |
194 | 200 | | |
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| 205 | + | |
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
| |||
799 | 809 | | |
800 | 810 | | |
801 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
802 | 854 | | |
803 | 855 | | |
804 | 856 | | |
| |||
0 commit comments