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

Remove unnecessary clones and allocations. #3

Merged
merged 2 commits into from Oct 10, 2023

Conversation

ryanavella
Copy link
Contributor

@ryanavella ryanavella commented Oct 8, 2023

This should reduce the number of allocations to just N+O(1) the minimum overhead required for parsing JSON.

One more allocation can be removed with a breaking change so I haven't included that change here, but the signature of stop_words::get could easily be changed to accept a AsRef<str> instead of a Into<String>.

pub fn get<T: Into<String>>(input_language: T) -> Vec<String> {

@cmccomb
Copy link
Owner

cmccomb commented Oct 10, 2023

Thanks for the PR!

@cmccomb cmccomb merged commit 067dcc2 into cmccomb:master Oct 10, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants