fix: satisfy stricter clippy lints CI's newer stable toolchain catches

CI failed with cargo clippy --workspace --all-targets -- -D warnings,
not a test. The actual cause: I'd been validating locally against
rustc/clippy 1.95.0 (the toolchain this machine had installed before
now), while CI installs plain "stable" (1.99.0 as of this run) — two
lints new since 1.95.0 fired there and nowhere in my local checks:

- clippy::int_plus_one on `src.end.row + 1 <= cap` in grid.rs,
  simplified to `src.end.row < cap` (same meaning, no overflow risk
  change: row is a u32 and cap is already saturating-clamped below
  MAX_ROWS - 1, so src.end.row + 1 can't wrap).
- clippy::disallowed_methods on the new fill_handle_perf example's
  three Instant::now() calls — the project's own lint from the time-
  panic fix (#125 history): reading the clock traps on wasm. This
  example is native-only (a `cargo run --release` benchmark, never
  built for wasm), so it gets the same #![allow(...)] perf.rs already
  carries, with the same justification.

Updated the local toolchain to stable (rustup update stable) and
re-ran cargo clippy --workspace --all-targets -- -D warnings clean
before this push, to actually match what CI checks instead of
guessing again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Dejan Port
2026-10-12 02:52:07 +02:00
co-authored by Claude Sonnet 5
parent e7d590c8a4
commit 7ba3676f5f
2 changed files with 3 additions and 1 deletions
@@ -2,6 +2,8 @@
//! row-by-row `value_ref` loop from `grid.rs` vs. `Sheet::last_contiguous_nonempty`.
//! `cargo run --release -p gridcraft-engine --example fill_handle_perf -- [rows]`
#![allow(clippy::disallowed_methods)] // a native-only benchmark: wasm never runs it
use std::time::Instant;
use gridcraft_engine::Session;
+1 -1
View File
@@ -2055,7 +2055,7 @@ fn interact(app: &mut SheetApp, ui: &mut egui::Ui, resp: &egui::Response, geo: &
let src = sel.current();
let neighbour = if src.start.col > 0 { src.start.col - 1 } else { src.end.col + 1 };
let cap = src.end.row.saturating_add(1_000_000).min(MAX_ROWS - 1);
let last = if src.end.row + 1 <= cap { sh.last_contiguous_nonempty(neighbour, src.end.row + 1, cap) } else { src.end.row };
let last = if src.end.row < cap { sh.last_contiguous_nonempty(neighbour, src.end.row + 1, cap) } else { src.end.row };
if last > src.end.row {
let target = RangeRef::new(src.start, CellRef::new(last, src.end.col));
let _ = app.run("edit.autoFill", json!({"source": src.a1(), "target": target.a1()}));