9 ms·
Using the experimental slicing syntax x.as_slice() can now be x[] which is a lot better. I'm not sure what will happen to .to_string() but it's a recognized pro
by lawn 12y ago
Using the experimental slicing syntax x.as_slice() can now be x[] which is a lot better. I'm not sure what will happen to .to_string() but it's a recognized problem.
- FreeFull 12y agoAlternatively, since String implements Deref<str>, you can do &*x, and that works without enabling the slicing syntax (although the syntax is likely to be in 1.0).