Repository navigation
fix(editor-doc): iterate the style rules with enumerate, for clippy 1.100 - #143
Merged
Merged
Conversation
….100 CI installs `stable` unpinned, and rustc 1.100.0 (2026-11-09) reached the runners on 2026-11-12. Its clippy fails `needless_range_loop` on the style-rule scan in `Parser::read_styles` (`domparse.rs`), so `lint` was red on both the native and the wasm32 job for every pull request, with no change to the code: main's last green run (17:04Z) used 1.99.1, the next one 1.100.0. `for i in start..self.styles.len()` indexing `self.styles[i]` becomes `for (i, r) in self.styles.iter().enumerate().skip(start)`. The index is still the rule's position, which `found` and `after` carry on to the next scan, and a `start` past the end gives an empty scan in both forms, so the behaviour is the same. No `#[allow]`. Measured (2026-11-12, rustc 1.100.0 installed beside `stable`, which is 1.99.0 on this machine): - Before: `cargo clippy --workspace --all-targets --locked` warns once, at `domparse.rs:824`, and nowhere else (the only other output is cargo's own manifest warnings, which `-D warnings` does not turn into errors). - After: CI's two commands with `-D warnings` (native, and `-p thrust-worker --no-default-features --target wasm32-unknown-unknown`) and `cargo fmt --all --check` exit 0, and both logs show `thrust-editor-doc` checked. - `cargo nextest run -p thrust-editor-doc`: 31 passed (the leaky `thrust-editor-doc` control test reports LEAK, as before), 4 skipped. - Control: with every style rule skipped (`.skip(start + 100000)`, planted and reverted) three tests fail, `stage3_not_vacuous`, `parity_stage3_html_to_json` and `controls::baseline_has_zero_failures_and_no_schema_drift`, on the corpus cases `f-style-bold`, `f-style-deco` and `f-style-italic`, so the loop is under test. An off-by-one in the bound (`.skip(start + 1)`) is NOT caught: no corpus case depends on the first rule or on the rule after a match. The two forms are equal by construction, not by that test. Refs: #92 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 12, 2026
Picks up #143 (the clippy 1.100 fix), the only commit main gained since the last rebase, so that `lint` is green on this branch. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
lintis red on every pull request since 2026-11-12, with no change to the code: CI installsstableunpinned, and rustc 1.100.0 (2026-11-09) reached the runners that day. Main's last green run (17:04Z,8ca9a49) used 1.99.1; the next run used 1.100.0 and failedclippy::needless_range_loopincrates/thrust-editor-doc/src/domparse.rs:824, on both the native and the wasm32 job. It was seen on #142, a PR that does not touch the file.This PR changes that loop and nothing else:
iis still the rule's position (foundandaftercarry it to the next scan), and astartpast the end is an empty scan in both forms. No#[allow].This is the failure the open issue #92 describes (a clippy release turning
lintred). #92 stays open: this PR does not pin the toolchain. A pin is the lasting fix, and it changes how CI andscripts/rspick the compiler, so it is its own decision.Evidence (2026-11-12, local)
rustc 1.100.0 installed beside
stable, which is still 1.99.0 on this machine (scripts/rshard-codesstable, so the runs used a copy of it pointed at 1.100.0).cargo clippy --workspace --all-targets --lockedon 1.100.0 warns once, atdomparse.rs:824, and nowhere else. The only other output is cargo's own manifest warnings, which-D warningsafter--does not turn into errors (CI sets neitherRUSTFLAGSnorbuild.warnings).lintjob, with-D warnings, exit 0 (native, and-p thrust-worker --no-default-features --target wasm32-unknown-unknown), andcargo fmt --all --checkexits 0. Both clippy logs showthrust-editor-docchecked.cargo nextest run -p thrust-editor-doc: 31 passed (the leakycontrolstest reports LEAK, as it does without this change), 4 skipped..skip(start + 100000), planted and reverted) three tests fail,stage3_not_vacuous,parity_stage3_html_to_jsonandcontrols::baseline_has_zero_failures_and_no_schema_drift, on the corpus casesf-style-bold,f-style-decoandf-style-italic: the loop is under test..skip(start + 1)) is not caught; no corpus case depends on the first rule or on the rule after a match. That the two forms are equal rests on the loop's shape, not on that test. The corpus is recorded from the TypeScript oracle, so I did not add a case by hand.Left alone
On 1.100.0 cargo also warns
unused dependencyfortokio-tungstenite(thrust-contract-tests),base64(thrust-editor-doc) andfutures-util(thrust-ports). They do not faillint, and I did not check whether they are real (a dependency used only in the wasm32 build, for one, would be a false positive), so they are not touched here.🤖 Generated with Claude Code