4 ms·
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
by wycats 12y ago
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_ 12y agoAt least you can now do: foo[].some_slice_method()
- kibwen 12y agoI 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 12y agoWe will almost certainly just have `Deref<str> for String` and so autoderef will handle `some_string.some_slice_method()` correctly.
- kibwen 12y agoWill we be able to kill the slicing syntax, then? :)
- heinrich5991 12y agoSlicing syntax is about being able to do stuff like string[1:3] AFAIK, so I hope it won't get killed.