Skip to content

Create an abbreviate function which can shorten text to a specific width #513

@mgeisler

Description

@mgeisler

We have all the infrastructure (and dependencies) needed to add a small abbreviate or truncate function which will shorten text to a specific width.

The most forward way is wrong in Rust: returning &s[..width] is prone to panicking since you can end up slicing into a Unicode character.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions