-
Notifications
You must be signed in to change notification settings - Fork 174
[ISSUE #4092]♻️Clean up existing clippy warnings of bool_assert_comparison and assertions_on_constant #4091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- bool_assert_comparison - assertions_on_constant
🔊@WaterWhisperer 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses clippy warnings for bool_assert_comparison
and assertions_on_constant
by converting assert_eq!(expr, true/false)
patterns to use assert!(expr)
and assert!(!expr)
directly. The changes improve code readability and follow Rust best practices for boolean assertions.
- Replaces
assert_eq!(expr, true)
withassert!(expr)
throughout test modules - Replaces
assert_eq!(expr, false)
withassert!(!expr)
throughout test modules - Simplifies pattern matching assertions using
matches!
macro in one case
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
rocketmq-store/src/store/running_flags.rs | Updated boolean assertions in RunningFlags tests |
rocketmq-store/src/ha/ha_connection_state_notification_request.rs | Simplified boolean assertions in HA connection tests |
rocketmq-remoting/src/protocol/namespace_util.rs | Updated namespace utility function test assertions |
rocketmq-remoting/src/protocol/header/reply_message_request_header.rs | Fixed assertion for None check in header tests |
rocketmq-remoting/src/protocol/header/message_operation_header/send_message_request_header_v2.rs | Updated boolean field assertions in message header tests |
rocketmq-remoting/src/protocol/header/message_operation_header/send_message_request_header.rs | Updated boolean field assertions in message header tests |
rocketmq-remoting/src/protocol/header/create_topic_request_header.rs | Simplified boolean assertions in topic creation tests |
rocketmq-remoting/src/protocol/body/topic_info_wrapper/topic_config_wrapper.rs | Updated empty collection assertion |
rocketmq-common/src/utils/util_all.rs | Updated utility function test assertions |
rocketmq-common/src/utils/queue_type_utils.rs | Updated queue type utility test assertions |
rocketmq-common/src/utils/cleanup_policy_utils.rs | Updated cleanup policy test assertions |
rocketmq-common/src/common/namesrv/namesrv_config.rs | Updated nameserver configuration test assertions |
rocketmq-common/src/common/config.rs | Updated topic configuration test assertions |
rocketmq-common/src/common/attribute/bool_attribute.rs | Updated boolean attribute parsing test assertions |
rocketmq-broker/src/topic/manager/topic_queue_mapping_manager.rs | Updated pointer equality assertion |
rocketmq-broker/src/client/consumer_group_event.rs | Replaced verbose pattern matching with matches! macro |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4091 +/- ##
=======================================
Coverage 26.48% 26.48%
=======================================
Files 574 574
Lines 81205 81201 -4
=======================================
+ Hits 21507 21508 +1
+ Misses 59698 59693 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Which Issue(s) This PR Fixes(Closes)
#4087 Not completed yet.
Fix #4092
Brief Description
Clean up existing clippy warnings of types:
How Did You Test This Change?
All these modifications have been made in the tests module and all the tests passed when running
cargo test