Commit 043421f
committed
fix: no deref index-expr for extract_function
Example
---
```rust
fn foo() {
let mut arr = [1i32];
$0arr[0] = 3;$0
let _ = arr;
}
```
**Before this PR**
```rust
fn foo() {
let mut arr = [1i32];
fun_name(&mut arr);
let _ = arr;
}
fn $0fun_name(arr: &mut [i32; 1]) {
*arr[0] = 3;
}
```
**After this PR**
```rust
fn foo() {
let mut arr = [1i32];
fun_name(&mut arr);
let _ = arr;
}
fn $0fun_name(arr: &mut [i32; 1]) {
arr[0] = 3;
}
```1 parent 7b6e124 commit 043421f
1 file changed
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2088 | 2088 | | |
2089 | 2089 | | |
2090 | 2090 | | |
2091 | | - | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
2092 | 2096 | | |
2093 | 2097 | | |
2094 | 2098 | | |
| |||
3211 | 3215 | | |
3212 | 3216 | | |
3213 | 3217 | | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
3214 | 3244 | | |
3215 | 3245 | | |
3216 | 3246 | | |
| |||
0 commit comments