Open mgeisler opened 1 year ago
We have all the infrastructure (and dependencies) needed to add a small abbreviate or truncate function which will shorten text to a specific width.
abbreviate
truncate
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.
&s[..width]
We have all the infrastructure (and dependencies) needed to add a small
abbreviate
ortruncate
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.