Skip to content

led: extras: fix cargo clippy complaining about String construction#49

Merged
hnez merged 1 commit into
linux-automation:mainfrom
hnez:cargo-clippy-leds
Oct 6, 2023
Merged

led: extras: fix cargo clippy complaining about String construction#49
hnez merged 1 commit into
linux-automation:mainfrom
hnez:cargo-clippy-leds

Conversation

@hnez
Copy link
Copy Markdown
Member

@hnez hnez commented Oct 6, 2023

The latest cargo clippy learned a new trick to optimize the construction of Strings and will not give us green CI builds before we adapt to it.

  • Does this make a difference in this case performance wise? No
  • Does this make cargo clippy happy? Yes

So let's do it.

…ld String

Use Iterator::fold() and write! instead.

Does this make a difference in this case performance wise? No
Does this make cargo clippy happy? Yes

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Copy link
Copy Markdown
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

lgtm!

@hnez hnez merged commit cca43b5 into linux-automation:main Oct 6, 2023
@hnez hnez deleted the cargo-clippy-leds branch October 6, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants