Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
likpok
6y ago
0 comments
Share
Does rust have a structure to handle something like a stringview?
0 comments
default
newest
oldest
marcianx
6y ago
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...
masklinn
6y ago
That's one of the language's primitives:
https://doc.rust-lang.org/std/primitive.str.html
j
/
k
navigate · click thread line to collapse