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

collect optimization ? #99

Open
wiiznokes opened this issue Apr 13, 2024 · 1 comment
Open

collect optimization ? #99

wiiznokes opened this issue Apr 13, 2024 · 1 comment

Comments

@wiiznokes
Copy link

I want to use this crate to normalize a search, so i have concern about the performance of .collect::<String>.

Is there a way to reuse the previous value, when possible ?

When i try .collect::<Cow<str>>, i always see Owned("...") in the debugger.

@Manishearth
Copy link
Member

.collect() is a trait method so I don't think it can be optimized that way, but I'm open to there being other APIs for it if it doesn't end up being too complicated

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

No branches or pull requests

2 participants