chore: address cargo clippy warnings and fix failing tests#1289
Open
Kayd-06 wants to merge 1 commit intomofa-org:mainfrom
Open
chore: address cargo clippy warnings and fix failing tests#1289Kayd-06 wants to merge 1 commit intomofa-org:mainfrom
Kayd-06 wants to merge 1 commit intomofa-org:mainfrom
Conversation
849088f to
fac74df
Compare
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.
Summary
This PR addresses several
cargo clippywarnings to improve code quality, maintainability, and compilation reliability across the workspace. It focuses on resolving type complexity warnings, simplifying conditional logic, streamlining vector initialization, and fixing type inference issues in tests/benches to ensure the entire workspace compiles seamlessly.Context
While running
cargo clippyandcargo testacross the workspace, several warnings and compilation errors were identified inmofa-foundation,mofa-kernel,mofa-cli, andmofa-local-llm.if letblocks were unnecessarily deep.This change is needed to guarantee a warning-free and fully compilable codebase for all targets and features.
Changes
mcp_integrationtests and brought theModelProvidertrait into scope for inference benchmarks to resolve compilation errors.clippy::approx_constant.if let x = y { if z { ... } }blocks into cleanerif let x = y && zlet-chains in budget.rs..push()statements into a singlevec![]macro.How you Tested
cargo clippy --all-targets --all-featuresto ensure all addressed warnings were resolved.cargo test -p mofa-foundation -p mofa-kernel -p mofa-clito verify that unit and integration tests (including the previously failing ones) pass successfully.Screenshots / Logs (if applicable)
N/A
Breaking Changes
Checklist
Code Quality
cargo fmtruncargo clippypasses without warningsTesting
cargo testpasses locally without any errorDocumentation
PR Hygiene
Deployment Notes (if applicable)
N/A
Additional Notes for Reviewers
N/A