Trait width method use refactor

This commit is contained in:
Ivan Tham 2021-06-26 09:45:49 +08:00 committed by Nathan Vegdahl
parent a6cadddef4
commit ed1a745442

View File

@ -309,7 +309,7 @@ pub fn set_string_truncated<S>(
index += width;
x_offset += width;
}
if ellipsis && x_offset - (x as usize) < UnicodeWidthStr::width(string.as_ref()) {
if ellipsis && x_offset - (x as usize) < string.as_ref().width() {
self.content[index].set_symbol("");
}
(x_offset as u16, y)