3 ms·
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, unsurprisi
by bobbylarrybobby 3y 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.
- steveklabnik 3y agoYeah, the general concept here is https://en.wikipedia.org/wiki/String_interning https://en.wikipedia.org/wiki/String_interning, Box<str> is great for it.