From b3fc6fc112c8741fd59b15805fb453e5a81e8d81 Mon Sep 17 00:00:00 2001 From: Kyosuke Fujimoto Date: Wed, 22 May 2024 17:11:42 +0900 Subject: [PATCH] Update ratatui to 0.26.3 --- Cargo.lock | 16 +++++++++++++--- Cargo.toml | 2 +- src/widget/copy_detail_dialog.rs | 3 +-- src/widget/header.rs | 8 +++----- src/widget/save_dialog.rs | 3 +-- src/widget/scroll_list.rs | 10 +++++----- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bd257c..fcaa16b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1969,15 +1969,14 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564a852040e82671dc50a37d88f3aa83bbc690dfc6844cfe7a2591620206a80" +checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef" dependencies = [ "bitflags 2.4.0", "cassowary", "compact_str", "crossterm", - "indoc", "itertools 0.12.1", "lru", "paste", @@ -1985,6 +1984,7 @@ dependencies = [ "strum", "time", "unicode-segmentation", + "unicode-truncate", "unicode-width", ] @@ -2877,6 +2877,16 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +[[package]] +name = "unicode-truncate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5fbabedabe362c618c714dbefda9927b5afc8e2a8102f47f081089a9019226" +dependencies = [ + "itertools 0.12.1", + "unicode-width", +] + [[package]] name = "unicode-width" version = "0.1.10" diff --git a/Cargo.toml b/Cargo.toml index fbd2c73..32f6fd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ humansize = "2.1.3" itertools = "0.13.0" itsuki = "0.2.0" open = "5.1.3" -ratatui = { version = "0.26.2", features = [ +ratatui = { version = "0.26.3", features = [ "all-widgets", "unstable-widget-ref", ] } diff --git a/src/widget/copy_detail_dialog.rs b/src/widget/copy_detail_dialog.rs index 7be5755..7e11ef4 100644 --- a/src/widget/copy_detail_dialog.rs +++ b/src/widget/copy_detail_dialog.rs @@ -111,7 +111,6 @@ fn build_list_item( #[cfg(test)] mod tests { use chrono::{DateTime, Local, NaiveDateTime}; - use ratatui::assert_buffer_eq; use crate::set_cells; @@ -164,7 +163,7 @@ mod tests { (4..36, [5, 6]) => fg: Color::Cyan, } - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); } fn file_detail() -> FileDetail { diff --git a/src/widget/header.rs b/src/widget/header.rs index 98e3e42..4e3f46d 100644 --- a/src/widget/header.rs +++ b/src/widget/header.rs @@ -69,8 +69,6 @@ impl Header { #[cfg(test)] mod tests { - use ratatui::assert_buffer_eq; - use super::*; #[test] @@ -89,7 +87,7 @@ mod tests { "│ bucket / key01 / key02 / key03 │", "└────────────────────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); } #[test] @@ -108,7 +106,7 @@ mod tests { "│ bucket / ... / key02a / key03 │", "└────────────────────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); } #[test] @@ -123,6 +121,6 @@ mod tests { "│ │", "└────────────────────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); } } diff --git a/src/widget/save_dialog.rs b/src/widget/save_dialog.rs index fa11b49..047ae12 100644 --- a/src/widget/save_dialog.rs +++ b/src/widget/save_dialog.rs @@ -65,7 +65,6 @@ impl StatefulWidget for SaveDialog { #[cfg(test)] mod tests { use crossterm::event::KeyCode; - use ratatui::assert_buffer_eq; use super::*; @@ -105,7 +104,7 @@ mod tests { " ", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); assert_eq!(state.cursor(), (12, 9)); } } diff --git a/src/widget/scroll_list.rs b/src/widget/scroll_list.rs index ea56e56..7d4f8ee 100644 --- a/src/widget/scroll_list.rs +++ b/src/widget/scroll_list.rs @@ -140,7 +140,7 @@ fn format_list_count(total_count: usize, selected: usize) -> String { #[cfg(test)] mod tests { - use ratatui::{assert_buffer_eq, text::Line}; + use ratatui::text::Line; use super::*; @@ -171,7 +171,7 @@ mod tests { "└──────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); } #[test] @@ -196,7 +196,7 @@ mod tests { "└──────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); for _ in 0..9 { state.select_next(); @@ -219,7 +219,7 @@ mod tests { "└──────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); for _ in 0..4 { state.select_next(); @@ -242,7 +242,7 @@ mod tests { "└──────────────────┘", ]); - assert_buffer_eq!(buf, expected); + assert_eq!(buf, expected); } fn render_scroll_list(state: &mut ScrollListState) -> Buffer {