You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: silence clippy 1.95 lint regressions across workspace (#18)
* chore: silence clippy 1.95 lint regressions across workspace
Rust 1.95.0 promoted several lints to default-warn (and CI runs with
`-D warnings`), causing a cascade of build failures across mlxcel-core
and mlxcel-surgery that had nothing to do with their underlying logic.
This commit makes the workspace lint-clean again under the new toolchain.
Auto-fixed via `cargo clippy --fix`:
- `manual_is_multiple_of` → `.is_multiple_of()` (pack3, quant3, utils)
- `manual_div_ceil` → `.div_ceil()` (utils)
- `unnecessary_cast` (quant, codebook, generate, etc.)
- `useless_conversion` (generate)
- `double_parens` (mtp/tests)
Manually rewritten:
- `needless_range_loop` → iterator + take/enumerate where the conversion
was clear (utils, quant, quant3, sampling, boundary, turbo_tests).
- `field_reassign_with_default` → struct-init form (generate, speculative).
- `doc_overindented_list_items` → list-continuation indent normalised
(speculative/mtp/generator).
- `doc_lazy_continuation` → reworded the `softmax + cold-V` paragraph in
turbo_tests so a leading `+` no longer parses as a markdown list marker.
- `unusual_byte_groupings` → `0xC0FF_EE42` (pack3, quant).
- `duplicated_attribute` → drop inner `#![cfg(test)]` where the parent
module already gates with `#[cfg(test)]` (mlxcel-surgery).
- Added a `# Safety` section to `attention_from_ptr` (layers).
Targeted `#[allow(...)]` (intentional shape, not worth restructuring):
- `too_many_arguments` on the attention-dispatch helpers in `layers.rs`
and the `attention_sparse_v_turbo4{,_fused}` kernels: positional
signatures intentionally mirror Metal/MLX call sites.
- `needless_range_loop` on `forward_batched`: mixed indexing into
`input_ids` slices and `batch_caches[i]` is clearer than enumerate.
- `large_enum_variant` / `result_large_err` on the paged-cache adopt
path: shrinking the variant would force callers through `Box` for no
runtime gain on a cold path.
- `type_complexity` on the `SyntheticTarget` test fixture's
`rollback_events`: it is a one-off test type.
`cargo clippy --workspace --all-targets -- -D warnings` is clean and
`cargo test --workspace` matches the pre-existing baseline (the same two
`multimodal::video` fd-variant tests fail on `main` too, due to runtime
ffmpeg policy mismatches unrelated to this change).
* chore: silence two more clippy errors gated by metal,accelerate features
The earlier sweep ran without `--features metal,accelerate`, so the CI
build (which uses that exact feature set) still tripped on two finds:
- `quant.rs:422` unnecessary `as usize` cast on an already-usize index
- `generate.rs:826` explicit `.into_iter()` inside `zip(...)` which
already accepts any `IntoIterator`
`cargo clippy --workspace --all-targets --features metal,accelerate
-- -D warnings` is now clean.
* chore: drop another useless into_iter in speculative_burst zip
server::batch::speculative_burst::zip already accepts IntoIterator, so
the explicit `.into_iter()` on rows_tokens is redundant. Missed in the
prior sweep because the local check ran against a cached clippy result
where this file was unchanged; `cargo clean` followed by a fresh
`cargo clippy --workspace --all-targets --features metal,accelerate --
-D warnings` confirms the workspace is now clean.
0 commit comments