Skip to content

Support &str in the printer algebra #611

@lpil

Description

@lpil

Currently the Document enum structure can only contain Strings, so any time we have a &str we need to allocate a String and copy the &str into it.

Add a new enum variant for Document which can hold a &str, allowing us to remove lots of cloning from the Erlang printer and Gleam formatter.

This will require adding an explicit lifetime to the Document enum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedContributions encouraged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions