Skip to content

clippy: Deny str::len #914

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

Merged
merged 1 commit into from
Nov 20, 2024
Merged

clippy: Deny str::len #914

merged 1 commit into from
Nov 20, 2024

Conversation

cgwalters
Copy link
Collaborator

When I was working on some column printing code
with Unicode I got bit by using str::len...and
digging in I found that clippy actually just
merged a lint to go the other way; more in
the link in the code.

Turning on a lint showed one place that should
have been using chars().count() and one that
should have been validating ASCII. Fix those.

When I was working on some column printing code
with Unicode I got bit by using `str::len`...and
digging in I found that clippy actually just
merged a lint to go the *other* way; more in
the link in the code.

Turning on a lint showed one place that should
have been using `chars().count()` and one that
should have been validating ASCII. Fix those.

Signed-off-by: Colin Walters <walters@verbum.org>
Copy link
Collaborator

@jeckersb jeckersb left a comment

Choose a reason for hiding this comment

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

Strings are hard. At least rust makes you confront that reality upfront!

@jeckersb jeckersb merged commit 9d10a78 into bootc-dev:main Nov 20, 2024
30 of 32 checks passed
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