Commit 9039de6
authored
Rollup merge of rust-lang#111492 - calebcartwright:by-ref-tokentree-1, r=compiler-errors
use by ref TokenTree iterator to avoid a few clones
Just a handful of swaps from the by-value cursor to by-ref cursor so as to avoid some unnecessary clones.
I've been doing some analysis on internal cleanup opportunities within rustfmt and as part of that yak-shave I found myself perusing broader token stream and tree usage (which we use within rustfmt). As reflected in some inline comments on the cursor structs (not part of this diff), there's probably many other such cases throughout the code, but figured I'd start small with these while I had the time. May take a look at the other sites in the futureFile tree
3 files changed
+6
-6
lines changed- compiler
- rustc_builtin_macros/src
- rustc_lint/src
3 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1882 | 1882 | | |
1883 | 1883 | | |
1884 | 1884 | | |
1885 | | - | |
1886 | | - | |
| 1885 | + | |
| 1886 | + | |
1887 | 1887 | | |
1888 | 1888 | | |
1889 | 1889 | | |
| |||
1944 | 1944 | | |
1945 | 1945 | | |
1946 | 1946 | | |
1947 | | - | |
| 1947 | + | |
1948 | 1948 | | |
1949 | 1949 | | |
1950 | | - | |
| 1950 | + | |
1951 | 1951 | | |
1952 | 1952 | | |
1953 | 1953 | | |
| |||
0 commit comments