Skip to content

Conversation

WaterWhisperer
Copy link
Contributor

@WaterWhisperer WaterWhisperer commented Sep 22, 2025

Which Issue(s) This PR Fixes(Closes)

#4087 Not complete yet
fix #4105

Brief Description

Clean up existing clippy warnings of types:

  • new_without_default
  • field_reassign_with_default
  • const_is_empty
  • large_enum_variant

How Did You Test This Change?

- new_without_default
- field_reassign_with_default
- const_is_empty
- large_enum_variant
@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 10:05
@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 Rust Clippy warnings to improve code quality by fixing specific warning types: new_without_default, field_reassign_with_default, const_is_empty, and large_enum_variant.

  • Wraps large enum variant in Box to reduce memory usage
  • Replaces mutable field reassignment patterns with struct initialization syntax
  • Adds Default implementations for structs with new() methods
  • Removes redundant constant emptiness tests

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rocketmq-store/src/message_store.rs Boxes large enum variant to reduce size
rocketmq-store/src/ha/flow_monitor.rs Replaces field reassignment with struct initialization
rocketmq-namesrv/src/processor/default_request_processor.rs Replaces field reassignment with struct initialization in tests
rocketmq-client/examples/ordermessage/ordermessage_consumer.rs Adds Default implementation for MyMessageListener
rocketmq-broker/src/metrics/pop_metrics_constant.rs Removes redundant const emptiness tests
rocketmq-broker/src/metrics/broker_metrics_constant.rs Removes redundant const emptiness tests
rocketmq-broker/benches/syncunsafecell_mut.rs Adds Default implementation for Test struct

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rocketmq-rust-robot rocketmq-rust-robot added the refactor♻️ refactor code label Sep 22, 2025
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.55%. Comparing base (c2ae50a) to head (bfdb3bb).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4100      +/-   ##
==========================================
- Coverage   26.56%   26.55%   -0.01%     
==========================================
  Files         575      575              
  Lines       81359    81356       -3     
==========================================
- Hits        21609    21606       -3     
  Misses      59750    59750              

☔ 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 new_without_default, field_reassign_with_default, const_is_empty, large_enum_variant [ISSUE #4105]♻️Clean up existing clippy warnings of new_without_default, field_reassign_with_default, const_is_empty, large_enum_variant Sep 22, 2025
@mxsm mxsm merged commit 49a9baa into mxsm:main Sep 22, 2025
16 of 30 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 13:34
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 new_without_default, field_reassign_with_default, const_is_empty, large_enum_variant

4 participants