From bf0923473c5cb7f2cff24b010f0072b5ce2f8cf2 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Mon, 22 Apr 2024 07:23:56 +0200 Subject: [PATCH] feat(table): make TableState::new const (#1040) --- src/widgets/table/table_state.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/table/table_state.rs b/src/widgets/table/table_state.rs index 5c1aeefe..b462d325 100644 --- a/src/widgets/table/table_state.rs +++ b/src/widgets/table/table_state.rs @@ -60,8 +60,11 @@ impl TableState { /// # use ratatui::{prelude::*, widgets::*}; /// let state = TableState::new(); /// ``` - pub fn new() -> Self { - Self::default() + pub const fn new() -> Self { + Self { + offset: 0, + selected: None, + } } /// Sets the index of the first row to be displayed