3 ms·
Does rust have a structure to handle something like a stringview?
by likpok 8y ago
Does rust have a structure to handle something like a stringview?
- marcianx 8y agoYes, 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-slices https://doc.rust-lang.org/book/ch04-03-slices.html#string-sl...
- masklinn 8y agoThat's one of the language's primitives: https://doc.rust-lang.org/std/primitive.str.html https://doc.rust-lang.org/std/primitive.str.html