HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by likpok | Hacker News Reader
Parent
Full thread
likpok
·
Does rust have a structure to handle something like a stringview?
View on HN
marcianx
·
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
·
That's one of the language's primitives:
https://doc.rust-lang.org/std/primitive.str.html
Reply on news.ycombinator.com