Commit 7285130
committed
Improve extract_function name
If the name contains `_`, it is likely to be descriptive
Example
---
```rust
fn foo(kind: i32) {
let is_complex = $0kind != 0$0;
}
```
**Before this PR**
```rust
fn foo(kind: i32) {
let is_complex = fun_name(kind);
}
fn fun_name(kind: i32) -> bool {
kind != 0
}
```
**After this PR**
```rust
fn foo(kind: i32) {
let is_complex = is_complex(kind);
}
fn is_complex(kind: i32) -> bool {
kind != 0
}
```1 parent 39018ac commit 7285130
1 file changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
245 | 248 | | |
246 | 249 | | |
247 | 250 | | |
| |||
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
255 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| |||
779 | 785 | | |
780 | 786 | | |
781 | 787 | | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
782 | 798 | | |
783 | 799 | | |
784 | 800 | | |
| |||
5430 | 5446 | | |
5431 | 5447 | | |
5432 | 5448 | | |
5433 | | - | |
| 5449 | + | |
5434 | 5450 | | |
5435 | 5451 | | |
5436 | 5452 | | |
5437 | 5453 | | |
5438 | | - | |
| 5454 | + | |
5439 | 5455 | | |
5440 | 5456 | | |
5441 | 5457 | | |
| |||
0 commit comments