Yes, the down side is another level of indirection. This could be optimized away for &'static str, but not for &str. Good point.
On Sat, Nov 9, 2013 at 12:06 AM, Patrick Walton <[email protected]>wrote: > On 11/8/13 2:00 PM, Oren Ben-Kiki wrote: > >> Also, str != ~[u8] (for good reason). The internal array is hidden >> anyway, so pretending to be a smart pointer to it doesn't make a lot of >> sense to me. Of course there's a very related issue of whether we see a >> vector as a smart pointer or as an object, so even if str was == ~[u8] >> it would probably still make sense to view it as an object :-) >> > > No! Read the thread! You need `&str and `&'static str` for performance as > well as `~str`. > > Patrick > >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
