Skip to content

Convert to and from AsciiString and Box<AsciiStr> #85

Closed
@A248

Description

@A248

A String is usually preferred to a Box<str>. However, there is one good reason to prefer the Boxed variant to the growable String, which is that String requires more memory. See https://users.rust-lang.org/t/use-case-for-box-str-and-string/8295/4

Similarly, Box<AsciiStr> uses less memory than AsciiString, so it would be helpful if there were ways to convert a AsciiString to a Box<AsciiStr>, just as it is possible to do so for String and Box<str>.

On my machine, Box<AsciiStr> uses 16 bytes compared to 24 bytes for AsciiString.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions