diff --git a/cursive-core/src/buffer.rs b/cursive-core/src/buffer.rs index 887dd029..80db9c19 100644 --- a/cursive-core/src/buffer.rs +++ b/cursive-core/src/buffer.rs @@ -10,9 +10,10 @@ use unicode_width::UnicodeWidthStr; /// The width of a cell. /// /// Most characters are single-width. Some asian characters and emojis are double-width. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] pub enum CellWidth { /// This character takes a single cell in the grid. + #[default] Single, /// This character takes 2 cells in the grid (mostly for emojis and asian characters). @@ -28,12 +29,6 @@ pub enum CellWidth { Quintuple, } -impl Default for CellWidth { - fn default() -> Self { - CellWidth::Single - } -} - impl CellWidth { /// Convert the width as returned from `UnicodeWidthStr::width()` into a `CellWidth`. /// diff --git a/cursive-core/src/menu.rs b/cursive-core/src/menu.rs index 14628f79..0fb6bf24 100644 --- a/cursive-core/src/menu.rs +++ b/cursive-core/src/menu.rs @@ -99,7 +99,7 @@ impl Item { /// Returns the styled lable for this item /// /// Returns a vertical bar string if `self` is a delimiter. - pub fn styled_label(&self) -> SpannedStr