Skip to content

Conversation

WaterWhisperer
Copy link
Contributor

@WaterWhisperer WaterWhisperer commented Sep 22, 2025

Which Issue(s) This PR Fixes(Closes)

#4087 Not completed yet.
Fix #4092

Brief Description

Clean up existing clippy warnings of types:

  • bool_assert_comparison
  • assertions_on_constant

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

- bool_assert_comparison
- assertions_on_constant
@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 07:07
@rocketmq-rust-bot
Copy link
Collaborator

🔊@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💥.

Copy link
Contributor

@Copilot Copilot AI left a 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) with assert!(expr) throughout test modules
  • Replaces assert_eq!(expr, false) with assert!(!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.

Copy link

codecov bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.48%. Comparing base (c84503b) to head (d262452).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mxsm mxsm changed the title [ISSUE #4087]♻️Clean up existing clippy warnings of bool_assert_comparison and assertions_on_constant [ISSUE #4092]♻️Clean up existing clippy warnings of bool_assert_comparison and assertions_on_constant Sep 22, 2025
Copy link
Owner

@mxsm mxsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mxsm mxsm merged commit 44d4700 into mxsm:main Sep 22, 2025
15 of 24 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Sep 22, 2025
@WaterWhisperer WaterWhisperer deleted the refactor-issueNo4087 branch September 22, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge refactor♻️ refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor♻️]Clean up existing clippy warnings of bool_assert_comparison and assertions_on_constant-1

4 participants