Skip to content

Commit

Permalink
feat(table): make TableState::new const (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Apr 22, 2024
1 parent 81b9633 commit bf09234
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/widgets/table/table_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf09234

Please sign in to comment.