diff --git a/src/ui/widget.rs b/src/ui/widget.rs index 65c67d90..9a08274b 100644 --- a/src/ui/widget.rs +++ b/src/ui/widget.rs @@ -23,6 +23,7 @@ pub type BoxedWidget = Box>; pub type UpdateCallback = fn(&S) -> Box; pub type EventCallback = fn(&dyn Any, UnboundedSender); +/// A `View`s common fields. pub struct BaseView { /// Message sender pub action_tx: UnboundedSender, @@ -103,7 +104,7 @@ where fn render(&self, frame: &mut Frame, area: Rect, props: Option>); } -/// Needs to be implemented for items that are supposed to be rendering in tables. +/// Needs to be implemented for items that are supposed to be rendered in tables. pub trait ToRow { fn to_row(&self) -> Vec; } @@ -560,8 +561,8 @@ where } fn update(&mut self, state: &S) { - self.props = TableProps::<'_, R>::from_callback(self.base.on_update, state) - .unwrap_or(self.props.clone()); + self.props = + TableProps::from_callback(self.base.on_update, state).unwrap_or(self.props.clone()); // TODO: Move to state reducer if let Some(selected) = self.state.selected() { @@ -609,7 +610,7 @@ where { fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option>) { let props = props - .and_then(TableProps::<'_, R>::from_boxed_any) + .and_then(TableProps::from_boxed_any) .unwrap_or(self.props.clone()); let widths: Vec = self