After #689 we keep in memory a keyword like :foo/bar as the String"foobar" with boundary = 3.
This is convenient at point of allocation and when comparing name and namespace, but one thing we frequently want to do with keywords is turn them into complete strings for printing, querying, or storage. To do that we end up constructing a new string:
If we were to keep the backing string in this composed format, we'd be able to implement AsRef<str> and print directly from the backing string, at the cost of two more bytes.
After #689 we keep in memory a keyword like
:foo/bar
as theString
"foobar"
withboundary = 3
.This is convenient at point of allocation and when comparing name and namespace, but one thing we frequently want to do with keywords is turn them into complete strings for printing, querying, or storage. To do that we end up constructing a new string:
If we were to keep the backing string in this composed format, we'd be able to implement
AsRef<str>
and print directly from the backing string, at the cost of two more bytes.