Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wycats
on Oct 13, 2014
|
parent
|
context
|
favorite
| on:
Why your first Rust FizzBuzz implementation may no...
Yes. It's a design bug that String and slice don't share a common trait and that `.as_slice()` is common simply to use slice methods.
I expect that to be fixed before 1.0.
bjz_
on Oct 13, 2014
[–]
At least you can now do: foo[].some_slice_method()
kibwen
on Oct 13, 2014
|
parent
[–]
I think this is an anti-pattern. I'm not a fan of the slicing syntax in general, which seems to exist only to paper over the missing traits that wycats mentions.
dbaupp
on Oct 13, 2014
|
root
|
parent
[–]
We will almost certainly just have `Deref<str> for String` and so autoderef will handle `some_string.some_slice_method()` correctly.
kibwen
on Oct 13, 2014
|
root
|
parent
[–]
Will we be able to kill the slicing syntax, then? :)
heinrich5991
on Oct 13, 2014
|
root
|
parent
[–]
Slicing syntax is about being able to do stuff like string[1:3] AFAIK, so I hope it won't get killed.
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
I expect that to be fixed before 1.0.