ratatui-toolkit 0.2.6

DEPRECATED: this crate was renamed to `ratkit`. Please migrate to `ratkit`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
pub fn display_width(s: &str) -> usize {
    s.chars()
        .map(|c| {
            let code = c as u32;
            if (0xF000..=0xF8FF).contains(&code) {
                2
            } else {
                unicode_width::UnicodeWidthChar::width(c).unwrap_or(1)
            }
        })
        .sum()
}