Skip to content

fix: unblock CI — allow clippy::result_large_err on projects_get - #422

Open
byte-the-bot wants to merge 1 commit into
mainfrom
fix/clippy-result-large-err
Open

fix: unblock CI — allow clippy::result_large_err on projects_get#422
byte-the-bot wants to merge 1 commit into
mainfrom
fix/clippy-result-large-err

Conversation

@byte-the-bot

Copy link
Copy Markdown
Collaborator

main is currently red on Lint, and it's blocking every open PR

Found while reviewing #398. That PR's Lint job failed on a file it doesn't touch:

error: the `Err`-variant returned from this function is very large
   --> server/src/http_server/pages/projects.rs:123:6
    |
123 | ) -> Result<Markup, Response> {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 128 bytes
    = note: `-D clippy::result-large-err` implied by `-D warnings`

projects.rs is byte-for-byte identical on main and on that branch, so this isn't PR-specific. I reproduced it on a clean checkout of main with clippy 0.1.98 — the same version CI resolves:

$ cargo clippy --all-targets -- -D warnings
error: the `Err`-variant returned from this function is very large
   --> server/src/http_server/pages/projects.rs:123:6

Why nobody noticed: main's last Rust CI run was 2026-08-08. actions-rust-lang/setup-rust-toolchain@v1 tracks stable, stable moved to 1.98 (2026-08-18), and result_large_err started firing here. Nothing has re-run on main since, so the breakage only shows up on PRs — where it reads as "your PR broke Lint."

The fix

#[allow(clippy::result_large_err)] on the one handler with this shape.

Clippy's suggested remedy (box the error) isn't available here: Err is an axum Response, which is ~128 bytes by construction, and axum requires the handler's error type to implement IntoResponseResponse is already the canonical one. So this is a genuine false positive for the axum handler pattern, not a real problem being papered over.

It's the only site in the workspace with this signature:

$ git grep -c "Result<Markup, Response>" -- server/src
server/src/http_server/pages/projects.rs:1

Verified

cargo fmt --all -- --check and cargo clippy --all-targets -- -D warnings both clean on a clean checkout of main with this change applied, using clippy 0.1.98.

Suggested follow-up (not in this PR)

A floating toolchain means this recurs on every clippy release, and it stays invisible until someone opens a PR. Either pin the toolchain via rust-toolchain.toml, or schedule the Rust CI workflow on main so drift surfaces on main instead of ambushing contributors.

🤖 Generated with Claude Code

`main` has been red on Lint since the stable toolchain floated to
clippy 1.98, which enforces `result_large_err` here. It went unnoticed
because main has not run Rust CI since 2026-08-08 — but every open PR
picks it up, so the whole repo's CI is currently blocked on it.

Clippy's suggested fix (box the error) is not available: `Err` is an
axum `Response`, ~128 bytes by construction, and axum requires the
handler error type to implement `IntoResponse`. `Response` is already
the canonical one, so the allow is the correct resolution rather than a
suppression of a real problem.

Reproduced on a clean checkout of main with clippy 0.1.98 and verified
`cargo clippy --all-targets -- -D warnings` is clean after the change.
This is the only site with the pattern in the workspace.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants