Skip to content

chore: clear the clippy warnings that were real (#32) - #99

Merged
jspaezp merged 1 commit into
mainfrom
chore/fix-warnings
Aug 28, 2026
Merged

chore: clear the clippy warnings that were real (#32)#99
jspaezp merged 1 commit into
mainfrom
chore/fix-warnings

Conversation

@jspaezp

@jspaezp jspaezp commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Twelve of the nineteen warnings; the other seven need a decision rather than an
edit.

Rebased onto main now that #98 has merged, so this is a single commit again.
One semantic fixup folded in: #98 added a test asserting on
DiannReadingError::DiannPrecursorParsingError, which this PR renames to
PrecursorParsing. Git rebased cleanly and the breakage only showed up at
compile time.

Fixed

  • very_complex_type x6 -- the three timscentroid benchmark examples spelled
    ((f32,f32),(f32,f32),(f16,f16)) six times between them. Each gets a BenchQuery
    alias.
  • enum_variant_names x3 -- Diann/Skyline/SpectronautReadingError suffixed
    every variant with Error, so a match arm read DiannReadingError::IoError.
    Suffix dropped.
  • should_implement_trait -- DecoyMode::from_str was an inherent method
    shadowing the trait, so "reverse".parse::<DecoyMode>() did not work at all. It
    implements FromStr now, and the one call site uses .parse().
  • mut_range_bound -- speclib_build_cli's digest loop hand-rolled a counter
    next to the iterator; it uses enumerate.

The one to look at

PossibleAggregator's variants carried the same redundant suffix, but it derives
clap's ValueEnum, so the variant names are the CLI values. A plain rename
would have silently changed --aggregator from chromatogram-aggregator to
chromatogram.

Renamed with the strings pinned by #[value(name = "...")], so the surface is
identical and now stated rather than implied. --help still offers exactly
point-intensity-aggregator, chromatogram-aggregator, spectrum-aggregator,
and the Carafe end-to-end test passes chromatogram-aggregator, so a future
rename that forgets the pin fails a test instead of breaking a caller.

Not fixed: 7 x too_many_arguments

Functions of 8-10 parameters. Silencing them with #[allow] would be suppression,
and bundling all seven into config structs is a real refactor with real regression
risk -- so it wants a call rather than my guess. They split two ways:

function
PyElutionGroup::new (pyo3 #[new]) the parameter list is the Python signature
render_chromatogram_plot (egui) flat render args are idiomatic there
run_pipeline, execute_pipeline, process_single_file would genuinely read better as a config struct
process_and_serialize, build_entry same

Happy to do the config-struct refactor for the bottom five as a follow-up.

@jspaezp
jspaezp force-pushed the chore/fix-warnings branch 2 times, most recently from 0f93f64 to 1c98614 Compare August 28, 2026 04:11
@jspaezp
jspaezp force-pushed the feat/source-id-text branch from 626dc91 to 52d84bd Compare August 28, 2026 05:43
Base automatically changed from feat/source-id-text to main August 28, 2026 15:54
12 of 19. The remaining 7 are all `too_many_arguments` and need a decision, not
a rename -- see the PR description.

- The three benchmark examples repeated `((f32,f32),(f32,f32),(f16,f16))` six
  times; each gets a `BenchQuery` alias.
- `Diann`/`Skyline`/`SpectronautReadingError` had every variant suffixed
  `Error`, so a match arm read `DiannReadingError::IoError`. Dropped the
  suffix.
- `DecoyMode::from_str` was an inherent method shadowing the `FromStr` trait,
  so `"reverse".parse()` did not work. It implements `FromStr` now.
- `speclib_build_cli`'s digest loop hand-rolled a counter; it uses `enumerate`.

`PossibleAggregator`'s variants also carried a redundant suffix, but they are a
clap `ValueEnum`, so the variant names ARE the CLI values. Renamed with the
strings pinned by `#[value(name = ...)]`, which the Carafe end-to-end test
covers -- `--help` still offers exactly `point-intensity-aggregator`,
`chromatogram-aggregator`, `spectrum-aggregator`.
@jspaezp
jspaezp force-pushed the chore/fix-warnings branch from 1c98614 to 03b19dd Compare August 28, 2026 16:02
@jspaezp
jspaezp merged commit 23048a2 into main Aug 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant