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

s/"\.to_string\(/"\.to_owned\( #26176

Closed
wants to merge 2 commits into from
Closed

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 10, 2015

don't go through formatting code to convert a str lit to a String

related: #19708

don't go through formatting code to convert a str lit to a String
@rust-highfive
Copy link
Collaborator

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Are there performance numbers for this change? This is not the idiomatic way of converting to a String, and it's a massive change to take without having some concrete motivation (e.g. numbers).

@steveklabnik
Copy link
Member

Yes, I've always been using to_string(), even though it's slower, because it's more semantically accurate. And it may get to be equally fast in the future, which would then make us switch this back, or at least, I'd hope so.

to_owned() is great for generic code, but outside of generics, to_string() is better.

@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 10, 2015

makes sense :) my motivation was far fetched anyway

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

5 participants