Documentation doesn't specify whether interned string will be moved.
I'm using StringInterner at the moment, but this clarification would be useful for all implementations.
I want to produce Cow<'inerner_owner, str> from strings and am wondering whether inserting new strings can cause their layout to shift.
Example:
["a", ..., "hello", "there", "world"], insert "hello world"
["a", ..., "hello world", "there"]
I'm assuming this isn't the case, but a backend that's optimized for minimal memory footprint could implement such optimizations, so it would be nice for docs to specify whether string position is persistent.
Documentation doesn't specify whether interned string will be moved.
I'm using
StringInternerat the moment, but this clarification would be useful for all implementations.I want to produce
Cow<'inerner_owner, str>from strings and am wondering whether inserting new strings can cause their layout to shift.Example:
["a", ..., "hello", "there", "world"], insert "hello world"["a", ..., "hello world", "there"]I'm assuming this isn't the case, but a backend that's optimized for minimal memory footprint could implement such optimizations, so it would be nice for docs to specify whether string position is persistent.