-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversions should not consume String #47
Labels
Milestone
Comments
👍. I'd be interested in a PR if you're up for it. If not I'll have a look over the next few days. |
whatisinternet
added a commit
that referenced
this issue
Mar 8, 2017
whatisinternet
added a commit
that referenced
this issue
Mar 8, 2017
whatisinternet
added a commit
that referenced
this issue
Mar 8, 2017
Merged
whatisinternet
added a commit
that referenced
this issue
Mar 9, 2017
whatisinternet
added a commit
that referenced
this issue
Mar 10, 2017
* Changed from `String` to `&str` to gain extra speed and fewer allocations. This moves the library to use `&str` as the input for most casting to avoid the extra allocation required for `to_string()` or `to_owned()`. Overall on local testing the benchmarks show a gain in every area. * Updated version * Updated changelog and readme to reflect changes See #47 * Passed char as &char * Updated readme with codecov * Extra cargo meta-data
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like most (all?) conversions create a new String, which means it should be sufficient for them to accept
&str
and not aString
.This way it would be possible to convert borrowed strings without cloning them (which is expensive due to extra temporary heap allocation and copying data).
The text was updated successfully, but these errors were encountered: