Hacker News new | ask | show | jobs
by bobbylarrybobby 887 days ago
Box<str> is used pervasively in the rust compiler instead of String for exactly this reason. Basically every string of code the compiler looks at is, unsurprisingly, constant.
1 comments

Yeah, the general concept here is https://en.wikipedia.org/wiki/String_interning, Box<str> is great for it.