-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make String/str, Vec/[] conversions more ergonomic #14983
Comments
cc me |
Another consideration regarding coercions: There are a number of constructors in std that want to take something like |
In Ruby, we have standard methods that convert things. If the call-ee wants a string, it will call I would expect this would be against the 'zero cost' mentality, though. |
1.0, P-high. |
I know rust doesn't really have a notion of a constructor function, but could this be a good case for the addition of a cast constructor, allowing for implicit casts. Totally a design decision, just wondering. This is defiantly one of my least favorite things about programming in rust at the moment. |
Note, the slice notation RFC would help here. |
|
I would think so! Nominating to be closed at the next triage meeting. |
team believes the issues here either are or will be handled by un-feature gating slice notation and/or other items in the RFC pipeline (such as deref coercions). Closing. |
There's a lot of code right now that does things like
frob(&"foo".to_string()).as_slice()
, using method calls to do both 'free' and non-free coercions. While the underlying string semantics may be good, it's not so usable as one might like.We need to figure out a way to minimize the burden of these, and other, coercion methods without compromising predictability.
Nominating.
The text was updated successfully, but these errors were encountered: