diff --git a/Cargo.toml b/Cargo.toml index 955a354..18626ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "managarr-tree-widget" description = "Tree Widget for Managarr" -version = "0.24.0" +version = "0.25.0" license = "MIT" repository = "https://github.com/Dark-Alex-17/managarr-tree-widget" authors = [ @@ -26,12 +26,12 @@ debug = true lto = true [dependencies] -ratatui = { version = "0.29", default-features = false } +ratatui = { version = "0.30", default-features = false } unicode-width = "0.2" [dev-dependencies] criterion = "0.5" -ratatui = "0.29" +ratatui = "0.30" [target.'cfg(target_family = "unix")'.dev-dependencies] pprof = { version = "0.14.0", features = ["criterion", "flamegraph"] } diff --git a/examples/example.rs b/examples/example.rs index c5ea71d..6901ad2 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -7,7 +7,7 @@ use ratatui::layout::{Position, Rect}; use ratatui::style::{Color, Modifier, Style}; use ratatui::text::Span; use ratatui::widgets::{Block, Scrollbar, ScrollbarOrientation}; -use ratatui::{crossterm, Frame, Terminal}; +use ratatui::{Frame, Terminal, crossterm}; #[must_use] struct App { @@ -129,7 +129,10 @@ fn main() -> std::io::Result<()> { Ok(()) } -fn run_app(terminal: &mut Terminal, mut app: App) -> std::io::Result<()> { +fn run_app>( + terminal: &mut Terminal, + mut app: App, +) -> std::io::Result<()> { const DEBOUNCE: Duration = Duration::from_millis(20); // 50 FPS let before = Instant::now(); @@ -144,7 +147,7 @@ fn run_app(terminal: &mut Terminal, mut app: App) -> std::io::Res let update = match crossterm::event::read()? { Event::Key(key) => match key.code { KeyCode::Char('c') if key.modifiers.contains(KeyModifiers::CONTROL) => { - return Ok(()) + return Ok(()); } KeyCode::Char('q') => return Ok(()), KeyCode::Char('\n' | ' ') => app.state.toggle_selected(), diff --git a/src/lib.rs b/src/lib.rs index e9f1105..3ce24a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,8 +46,7 @@ mod tree_state; /// .block(Block::bordered().title("Tree Widget")); /// /// frame.render_stateful_widget(tree_widget, area, &mut state); -/// })?; -/// # Ok::<(), std::io::Error>(()) +/// }).unwrap(); /// ``` #[must_use] #[derive(Debug, Clone)] diff --git a/src/tree_state.rs b/src/tree_state.rs index 4877680..985fd74 100644 --- a/src/tree_state.rs +++ b/src/tree_state.rs @@ -4,7 +4,7 @@ use std::collections::HashSet; use std::fmt::Display; use std::hash::Hash; -use crate::flatten::{flatten, Flattened}; +use crate::flatten::{Flattened, flatten}; use crate::tree_item::TreeItem; /// Keeps the state of what is currently selected and what was opened in a [`Tree`](crate::Tree).