chore(clippy): fix clippy warnings#301
Open
jagan-jaya wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses existing Clippy warnings across the decision engine and its crates by applying small, semantics-preserving refactors and more idiomatic Rust constructs (aligned with the repo MSRV of Rust 1.85.0).
Changes:
- Replace
Option::map_or(true, ...)withOption::is_none_or(...)for clearer intent. - Simplify numeric bounds checking using inclusive range
contains(...). - Reduce repetition and manual impls via
Self::...enum matching and#[derive(Default)]with#[default].
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/sr_auto_calibration.rs |
Uses is_none_or to simplify “missing value implies changed” logic for calibration updates. |
src/decider/gatewaydecider/multi_objective/hypersense_client.rs |
Refactors plausibility checks into range-based validation for readability (and stricter handling of non-finite values). |
src/analytics/models.rs |
Replaces explicit enum type names with Self to satisfy Clippy and reduce verbosity. |
crates/gsm/src/types.rs |
Removes manual Default impl in favor of derived Default with an explicit #[default] variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fix existing clippy warnings across crates