diff --git a/lib/cli/tui/widgets/gridselector/state.rs b/lib/cli/tui/widgets/gridselector/state.rs index 72f99af..85cc64b 100644 --- a/lib/cli/tui/widgets/gridselector/state.rs +++ b/lib/cli/tui/widgets/gridselector/state.rs @@ -12,10 +12,6 @@ use ratatui::text::Text; pub struct GridItem(String); impl GridItem { - // pub fn new(value: String) -> Self { - // Label(value) - // } - // accept both String and &str pub fn new(value: S) -> Self where @@ -25,13 +21,20 @@ impl GridItem { } } -// implement a way to convert Label into &str +// convert Label into &str impl AsRef for GridItem { fn as_ref(&self) -> &str { &self.0 } } +// convert Label into String +impl Into for GridItem { + fn into(self) -> String { + self.0.clone() + } +} + // Specify the lifetime for the implementation impl<'a> From for Text<'a> { fn from(val: GridItem) -> Self {