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 #4099

Brief Description

Clean up existing clippy warnings of types:

  • vec_init_then_push
  • redundant_closure
  • useless_conversion

How Did You Test This Change?

- vec_init_then_push
- redundant_closure
- useless_conversion
@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 08:53
@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 by cleaning up code patterns that are redundant or inefficient. The changes focus on removing unnecessary closures, eliminating redundant conversions, and replacing the vec-init-then-push pattern with direct vector initialization.

  • Simplifies closures in benchmark functions by removing redundant wrapper closures
  • Replaces vec initialization followed by multiple push operations with direct vec![] macro usage
  • Removes unnecessary type conversions like PathBuf::from() and .into_iter()

Reviewed Changes

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

Show a summary per file
File Description
rocketmq-store/benches/delivery.rs Simplified benchmark function closures
rocketmq-example/examples/consumer/pop_consumer.rs Removed redundant .into_iter() call
rocketmq-client/examples/batch/simple_batch_producer.rs Replaced vec initialization pattern with vec![] macro
rocketmq-client/examples/batch/callback_batch_producer.rs Replaced vec initialization pattern with vec![] macro
rocketmq-broker/src/broker_path_config_helper.rs Removed redundant PathBuf::from() conversion

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.56%. Comparing base (950bb02) to head (f490c4c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4097   +/-   ##
=======================================
  Coverage   26.56%   26.56%           
=======================================
  Files         575      575           
  Lines       81359    81359           
=======================================
  Hits        21609    21609           
  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.

Copy link
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot 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 changed the title [ISSUE #4087]♻️Clean up existing clippy warnings of vec_init_then_push, redundant_closure and useless_conversion [ISSUE #4099]♻️Clean up existing clippy warnings of vec_init_then_push, redundant_closure and useless_conversion 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 c2ae50a into mxsm:main Sep 22, 2025
17 of 31 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 09:32
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 vec_init_then_push, redundant_closure and useless_conversion

4 participants