Skip to content

Clippy fixes#642

Merged
ltratt merged 1 commit into
softdevteam:masterfrom
ratmice:clippy_fix
Jul 12, 2026
Merged

Clippy fixes#642
ltratt merged 1 commit into
softdevteam:masterfrom
ratmice:clippy_fix

Conversation

@ratmice

@ratmice ratmice commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

The first patch is hand written, so that the subsequent cargo clippy --fix won't introduce compilation errors with the borrow checker.

@ratmice

ratmice commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Perhaps rather than adding the trait impl, instead I should put more effort into rewriting the code block?

Maybe a match parsed_header block would fix it because it currently errors later when we parsed_header.unwrap(), and when using match the compiler knows both arms are disjoint.

Edit: That will work, but it is a 200+ line Ok(...) block for the rest of the function, which the unwrap was preventing indentation of. However the clippy if let ... && ... has reduced the indentation on the inner block significantly, so it really doesn't too terribly.

I went ahead and pushed that, happy to back it out though...

@ltratt

ltratt commented Jul 12, 2026

Copy link
Copy Markdown
Member

I think this is good. Do you want to squash?

@ratmice

ratmice commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

I went ahead and squashed, I'd rather keep the clippy/manual rewrites separate, but it seemed like a pain to do.
(Easier to just rewrite the whole patch if we want to preserve that)

@ltratt ltratt enabled auto-merge July 12, 2026 21:46
@ltratt ltratt disabled auto-merge July 12, 2026 22:03
@ltratt

ltratt commented Jul 12, 2026

Copy link
Copy Markdown
Member

Hmm, we've hit a now-classic GitHub problem and the only way I know how to resolve it is: can you amend the last commit (e.g. just update the time) and force push? [I wish I knew a better way to fix this...]

This required rewriting a code block avoid borrow a checker error introduced by clippy
@ratmice

ratmice commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Done.

@ltratt ltratt added this pull request to the merge queue Jul 12, 2026
Merged via the queue into softdevteam:master with commit 0875e21 Jul 12, 2026
2 checks passed
@ratmice ratmice deleted the clippy_fix branch July 13, 2026 02:57
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