Skip to content
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

a small question about cow-utils #8659

Open
heygsc opened this issue Jan 22, 2025 · 2 comments
Open

a small question about cow-utils #8659

heygsc opened this issue Jan 22, 2025 · 2 comments
Labels
C-enhancement Category - New feature or request

Comments

@heygsc
Copy link
Contributor

heygsc commented Jan 22, 2025

related: #8496

Sorry, I should have asked about it in the previous issue mentioned above. I didn't pay attention and it was already closed.

A small question, I'm really curious. Since cow_to_lowercase and some methods based on the benchmark will reduce performance, is it necessary to revert some methods in the disallowed-methods restriction in clippy?

@heygsc heygsc added the C-enhancement Category - New feature or request label Jan 22, 2025
@Boshen
Copy link
Member

Boshen commented Jan 22, 2025

Take a look at the call sites, most of them can be replaced with cow_to_ascii_uppercase as they don't need to deal with unicode casing.

Most call sites are comparing very short strings, which is still fast compared to always heap allocating in String::to_upper_case.

@heygsc heygsc closed this as completed Jan 22, 2025
@Boshen Boshen reopened this Jan 23, 2025
@Boshen
Copy link
Member

Boshen commented Jan 23, 2025

most of them can be replaced with cow_to_ascii_uppercase

We should refactor some of the call sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category - New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants