Skip to content

chore: auto-fix clippy warnings#17

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
auto-fix/clippy
Open

chore: auto-fix clippy warnings#17
github-actions[bot] wants to merge 1 commit into
mainfrom
auto-fix/clippy

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 18, 2026

Auto-generated PR

cargo clippy --fix found and fixed lint warnings.

Please review the changes before merging.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 18, 2026

审阅者指南(小型 PR 上默认折叠)

审阅者指南

这个 PR 由一些基于 clippy 的小型清理变更组成:它调整了一个测试辅助函数的可见性,移除了在构造 Filter 时不必要的 clone,并将断言消息格式字符串进行了现代化改写。

文件级变更

变更 详情 文件
将重载过滤器(reload-filter)测试辅助函数公开,并在构造 Filter 时移除不必要的 clone
  • build_reload_filter_for_test 的可见性从 crate 私有改为 public,以便它可以在多个模块或 crate 间使用,从而满足 clippy 的可见性 lint 要求。
  • 在调用 Filter::new 时直接传入 level,而不是调用 level.clone(),从而移除不必要的分配/拷贝。
src/reload/test.rs
在重载过滤器测试中现代化断言格式,使用内联 {:?} 格式化和具名捕获。
  • build_reload_filter_works 中的断言消息更新为使用 {result:?} 格式器,而不是位置 {:?} 加显式参数,从而满足 clippy 的格式化 lint 要求。
src/test.rs

提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 通过回复某条审阅评论,请求 Sourcery 从该评论创建一个 issue。你也可以回复该审阅评论 @sourcery-ai issue 来从中创建 issue。
  • 生成 pull request 标题: 在 pull request 标题中的任意位置写上 @sourcery-ai 以在任意时间生成标题。你也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在你想要的位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve 以一次性解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会非常有用。
  • 撤销所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss 以撤销所有现有的 Sourcery 审阅。尤其适用于你想从一个新的审阅重新开始的场景——别忘了再评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

访问你的控制面板 以:

  • 启用或禁用审阅功能,例如 Sourcery 自动生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR consists of small, clippy-driven cleanups: it adjusts visibility of a test helper, removes an unnecessary clone when constructing a Filter, and modernizes an assertion message format string.

File-Level Changes

Change Details Files
Expose the reload-filter test helper publicly and remove an unnecessary clone when constructing a Filter.
  • Change build_reload_filter_for_test visibility from crate-private to public so it can be used across modules or crates, satisfying clippy’s visibility lint.
  • Pass level directly into Filter::new instead of calling level.clone(), removing an unnecessary allocation/copy.
src/reload/test.rs
Modernize assertion formatting in a reload filter test to use inline {:?} formatting with named capture.
  • Update the assertion message in build_reload_filter_works to use the {result:?} formatter instead of positional {:?} with an explicit argument, satisfying clippy’s formatting lint.
src/test.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - 我已经审查了你的更改,一切看起来都很棒!


Sourcery 对开源项目是免费的——如果你喜欢我们的审查,请考虑分享它们 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进审查质量。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions github-actions Bot force-pushed the auto-fix/clippy branch 4 times, most recently from f3edfe1 to b2eb07b Compare May 19, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant