Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mgeisler opened this issue Jun 19, 2023 · 0 comments
Open

Comments

@mgeisler
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant