-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Assist: replace string with char #6256
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
Conversation
Signed-off-by: Benjamin Coenen <[email protected]>
4aa8609
to
d143bf2
Compare
Signed-off-by: Benjamin Coenen <[email protected]>
d143bf2
to
c22c039
Compare
let value = token.value()?; | ||
let target = token.syntax().text_range(); | ||
|
||
if value.is_empty() || value.chars().count() > 1 { |
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.
if value.is_empty() || value.chars().count() > 1 { | |
if value.chars().count() != 1 { |
but its probably best to avoid premature pessimization and call .next
twice manually instead of O(N) count
other then this, lgmt!
bors d+
✌️ bnjjj can now approve this pull request. To approve and merge a pull request, simply reply with |
Co-authored-by: Aleksey Kladov <[email protected]>
bors r+ |
close #6252