Re:Modern C++ Won't Save Us
by likpok on Monday April 22, 2019 @10:18PM
(#19725064)
Does rust have a structure to handle something like a stringview?
[ Parent
| on HN ]
Yes, a borrowed string slice `&str`, whose lifetime is tracked precisely by the compiler to avoid use-after-free errors.
https://doc.rust-lang.org/book/ch04-03-slices.html#string-sl...
That's one of the language's primitives: https://doc.rust-lang.org/std/primitive.str.html