pub trait HasWidth { // Required method fn width(&self) -> Width; }
Support for returning the unicode width of a text object
Return the unicode width of an object
use stylish_stringlike::text::{HasWidth, Width}; let foo = "foobar"; assert_eq!(foo.width(), Width::Bounded(6)); let bar = String::from("🙈🙉🙊"); assert_eq!(bar.width(), Width::Bounded(6));