fix(clippy): use Result::is_ok_and for Rust 1.98.0 manual_is_variant_and lint - #1631
Open
TheLarkInn wants to merge 1 commit into
Open
fix(clippy): use Result::is_ok_and for Rust 1.98.0 manual_is_variant_and lint#1631TheLarkInn wants to merge 1 commit into
TheLarkInn wants to merge 1 commit into
Conversation
Rust 1.98.0 clippy promotes clippy::manual_is_variant_and, which fires on `.ok().is_some_and(..)` called on a Result. This broke the Build & Test clippy step (`-D warnings`) on main. Replace with `is_ok_and` (stable since 1.70) at all six call sites, including test code. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates libaipm to satisfy Rust 1.98.0’s new clippy::manual_is_variant_and pedantic lint by replacing the Result::ok().is_some_and(..) pattern with the equivalent Result::is_ok_and(..), unblocking CI builds that run with -D warnings.
Changes:
- Replace
Result::ok().is_some_and(..)withResult::is_ok_and(..)in resolver candidate filtering logic. - Update enforcement env-var check to use
is_ok_and(..)directly on theResult. - Update affected test assertions to use
is_ok_and(..).
Show a summary per file
| File | Description |
|---|---|
| crates/libaipm/src/version.rs | Updates a test assertion to use Result::is_ok_and(..) instead of ok().is_some_and(..). |
| crates/libaipm/src/security.rs | Updates env-var enforcement check to use Result::is_ok_and(..) to satisfy the new clippy lint. |
| crates/libaipm/src/resolver/mod.rs | Updates version-parse filtering to use Result::is_ok_and(..) without changing selection behavior. |
| crates/libaipm/src/migrate/cleanup.rs | Updates several test assertions to use Result::is_ok_and(..) instead of ok().is_some_and(..). |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1631 +/- ##
=======================================
Coverage 97.57% 97.57%
=======================================
Files 127 127
Lines 39102 39102
Branches 974 974
=======================================
Hits 38154 38154
Misses 853 853
Partials 95 95 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 20, 2026
Open
Open
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
Rust 1.98.0 stable shipped a new pedantic clippy lint,
clippy::manual_is_variant_and, which fires on.ok().is_some_and(..)called on aResult. Because CI builds with-D warnings, the Build & Test job is now failing on main (first observed on #1630's run, which contains no Rust changes).This replaces
.ok().is_some_and(..)with the suggested.is_ok_and(..)(stable since Rust 1.70) at all six call sites:crates/libaipm/src/resolver/mod.rs:468crates/libaipm/src/security.rs:83crates/libaipm/src/migrate/cleanup.rs:204, 280, 293(tests)crates/libaipm/src/version.rs:331(test)Result::ok().is_some_and(f)andResult::is_ok_and(f)are semantically identical — behavior is unchanged.Unblocks #1630 and every other open PR.
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com