-
Notifications
You must be signed in to change notification settings - Fork 795
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
Rust 1.84 lints #6781
Rust 1.84 lints #6781
Conversation
@@ -57,7 +57,7 @@ impl FromStr for GraffitiString { | |||
type Err = String; | |||
|
|||
fn from_str(s: &str) -> Result<Self, Self::Err> { | |||
if s.as_bytes().len() > GRAFFITI_BYTES_LEN { | |||
if s.len() > GRAFFITI_BYTES_LEN { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is interesting. String length is in bytes, so makes sense:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i was confused as well, but the lint explicitly stated that they are equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Pawan!
Going to try merging this in the same batch as: |
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 1f6850f |
Issue Addressed
N/A
Proposed Changes
Fix all lints from rust 1.84.
.map_or(false..
tois_ok_and../is_some_and..
unnecessay_map_or&str
returns the number of bytes anyway so we were using as_bytes() unnecesssarily needless_as_bytes