Commit 5ea9b74
fix: eliminate production .unwrap() panic sites (6 → 0 bare unwraps)
Converts all bare `.unwrap()` calls in production code (outside test
modules) to `.expect("static regex is valid")` for the seven OnceLock
static-regex initialisers in analyzer.rs — matches the pattern already
used for the four LazyLock initialisers at the top of the file.
Fixes the one genuine panic risk: bridge/classify.rs line 100 called
`.first().unwrap()` on `fixed_versions` inside a branch guarded by
`semver_fix_available`, but that flag being true did not guarantee a
non-empty vec. Changed to `.first().map(String::as_str).unwrap_or("unknown")`.
All 6 surviving `.expect()` calls are structurally-unreachable invariants
with descriptive messages (infallible regex init; accumulator consumed by seal()).
200/200 lib tests passing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent db603c3 commit 5ea9b74
2 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1638 | 1638 | | |
1639 | 1639 | | |
1640 | 1640 | | |
1641 | | - | |
| 1641 | + | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | 1644 | | |
| |||
2494 | 2494 | | |
2495 | 2495 | | |
2496 | 2496 | | |
2497 | | - | |
| 2497 | + | |
2498 | 2498 | | |
2499 | 2499 | | |
2500 | 2500 | | |
| |||
4156 | 4156 | | |
4157 | 4157 | | |
4158 | 4158 | | |
4159 | | - | |
| 4159 | + | |
4160 | 4160 | | |
4161 | 4161 | | |
4162 | 4162 | | |
| |||
4361 | 4361 | | |
4362 | 4362 | | |
4363 | 4363 | | |
4364 | | - | |
| 4364 | + | |
4365 | 4365 | | |
4366 | 4366 | | |
4367 | 4367 | | |
| |||
4710 | 4710 | | |
4711 | 4711 | | |
4712 | 4712 | | |
4713 | | - | |
| 4713 | + | |
4714 | 4714 | | |
4715 | | - | |
| 4715 | + | |
4716 | 4716 | | |
4717 | 4717 | | |
4718 | 4718 | | |
| |||
4733 | 4733 | | |
4734 | 4734 | | |
4735 | 4735 | | |
4736 | | - | |
| 4736 | + | |
4737 | 4737 | | |
4738 | 4738 | | |
4739 | 4739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments