Commit ab94e64
style(rust): clear
## Why
`Build Check` runs **`cargo fmt --check` then `cargo clippy -- -D
warnings`** (`.github/workflows/security.yml:72-74`). On `main` the
*fmt* step failed first and **masked 31 pre-existing clippy errors**. PR
#84 fixes fmt; this PR clears the clippy half so the gate goes fully
green.
**Stacked on #84** (base = `claude/fix-rustfmt-nonconformity`) so this
PR's diff is **clippy-only** and its own `Build Check` can pass (it
needs the fmt fix present to get past the fmt step). When #84 merges,
GitHub auto-retargets this to `main`.
## What
- **Machine-applicable lints** via `cargo clippy --fix` across ~16 files
(needless borrows/clones, redundant `to_owned`, single-char string
patterns, `unused_enumerate_index`, …).
- **Hand-fixed** the non-machine-applicable ones — all
semantics-preserving:
- `while_let_loop` → `src/interpreter/value.rs`
- `manual_strip` ×2 → `src/stdlib/net.rs` (`strip_prefix`)
- `needless_range_loop` → `src/stdlib/time.rs` (`.iter().take(..)`)
- `collapsible_match` → `src/typechecker/mod.rs`
- `unnecessary_to_owned` → `src/sexpr.rs`
- `wildcard_in_or_patterns` → `src/main.rs`
- **`dead_code` scaffolding silenced, NOT deleted** (your call) with
`#[allow(dead_code)]` + a comment, since these look like reserved
scaffolding:
- `Precedence::Primary` (parser), `Parser::peek_next` (lookahead
helper), `vm::compiler` `Local.depth` (scope tracking).
- If you'd rather **delete** any of these, say so and I'll swap the
allow for removal.
## Verified locally
- `cargo fmt --check` — clean
- `cargo clippy -- -D warnings` — **exit 0**
- `cargo test --lib` — **173/173 pass** (confirms the
collapse/while-let/strip_prefix edits didn't change behavior)
cargo clippy -- -D warnings (the other half of Build Check) (#85)1 parent dccad8f commit ab94e64
19 files changed
Lines changed: 51 additions & 56 deletions
File tree
- src
- bin
- dap
- formatter
- interpreter
- linter
- parser
- security
- stdlib
- typechecker
- vm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
779 | | - | |
| 779 | + | |
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
191 | 186 | | |
192 | 187 | | |
193 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
| 406 | + | |
406 | 407 | | |
407 | 408 | | |
408 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
202 | | - | |
| 205 | + | |
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| |||
711 | 714 | | |
712 | 715 | | |
713 | 716 | | |
714 | | - | |
| 717 | + | |
715 | 718 | | |
716 | 719 | | |
717 | 720 | | |
| |||
989 | 992 | | |
990 | 993 | | |
991 | 994 | | |
992 | | - | |
| 995 | + | |
993 | 996 | | |
994 | 997 | | |
995 | 998 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
0 commit comments