[rust-dev] strings, slices and nulls
graydon at mozilla.com
Wed Apr 18 13:59:28 PDT 2012
On 12-04-18 01:54 PM, Brian Anderson wrote:
> As I think about this further, with slices we probably don't need as_buf
> or as_bytes since I think we will be able to create a string slice from
> a vec slice and vice versa.
Not if string slices are, as I say, one byte "longer" than the area of
interest. You can get a vec slice from a str slice but going the other
way won't work (you have no way to know if the vec is even addressable
one byte further than the slice).
More information about the Rust-dev