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

Fix owned string usage #3

Merged
merged 2 commits into from
May 30, 2014
Merged

Conversation

renato-zannon
Copy link
Contributor

Hi!

Recently ~"string" literals have been removed from rust master, being replaced by "string".to_owned().

The first commit is just an automatic conversion from the first form to the later, and by itself already makes the library compilable again on rust-nighly.

The second one removes multiple uses of "string".to_owned() that were unnecessary: "string" evaluates to &'static str, which is enough most of the time, and doesn't need heap allocation. It probably won't make any significant difference on speed or memory usage, but avoiding heap allocation when possible seems to be the current best practice for idiomatic rust.

@jsanders
Copy link
Owner

Whoops, thought I merged this already! 👍 Thanks!

jsanders added a commit that referenced this pull request May 30, 2014
@jsanders jsanders merged commit 71b58eb into jsanders:master May 30, 2014
@renato-zannon renato-zannon deleted the fix-owned-strings branch May 30, 2014 17:28
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.

2 participants