Skip to content
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

refactor: add 2 pedantic clippy lints for strings #19614

Merged
merged 9 commits into from
Dec 11, 2024
Merged

Conversation

BugenZhao
Copy link
Member

Signed-off-by: Bugen Zhao i@bugenzhao.comI hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

ToString::to_string internally forward to the Display trait. To get a owned version of an existing string, should prefer more specific methods.

  • str_to_string: prefer .to_owned() over .to_string() on &str
  • string_to_string: prefer .clone() over .to_string() on String or &String

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Signed-off-by: Bugen Zhao

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao requested review from stdrc and xxchan November 29, 2024 05:54
@graphite-app graphite-app bot requested a review from a team November 29, 2024 05:54
Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

Can you cherry-pick this to release branches? I'm worried it may cause conflicts frequently

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao force-pushed the bz/pedantic-str-lints branch from 9f6fe55 to 001b98d Compare November 29, 2024 06:33
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao force-pushed the bz/pedantic-str-lints branch from ad9ed16 to 0a625e9 Compare December 9, 2024 07:08
@BugenZhao BugenZhao enabled auto-merge December 9, 2024 07:09
@BugenZhao BugenZhao added this pull request to the merge queue Dec 9, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2024
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 9, 2024
@BugenZhao BugenZhao added this pull request to the merge queue Dec 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Dec 9, 2024
@BugenZhao BugenZhao enabled auto-merge December 10, 2024 09:51
@BugenZhao BugenZhao added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit 119e17e Dec 11, 2024
28 of 29 checks passed
@BugenZhao BugenZhao deleted the bz/pedantic-str-lints branch December 11, 2024 04:55
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.

2 participants