On 12-04-18 12:43 PM, Niko Matsakis wrote: > I can see the practicality of null-terminating, but I would really like > to preserve the flexibility to reverse that decision in the future. > Forcing people to go through str::as_bytes() to observe the null > terminating seems like a win—except that I'd probably call it as_cstr() > or something like that, to emphasize it's null-terminated-ness.
Right, but .. you can still observe it by allocating a str/5 in a record and noticing that it takes 6 bytes (i.e. with sizeof). Tolerable? -Graydon _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
