forked from containers/bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
disallowed-methods = [ | ||
# https://github.com/rust-lang/rust-clippy/issues/13434#issuecomment-2484292914 | ||
{ path = "str::len", reason = "use <str>.as_bytes().len() instead" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters