diff --git a/examples/demo2/big_text.rs b/examples/demo2/big_text.rs index 58b61eba..5b414f48 100644 --- a/examples/demo2/big_text.rs +++ b/examples/demo2/big_text.rs @@ -50,7 +50,7 @@ use std::cmp::min; use derive_builder::Builder; use font8x8::UnicodeFonts; -use ratatui::{prelude::*, text::StyledGrapheme, widgets::Widget}; +use ratatui::{prelude::*, text::StyledGrapheme}; #[allow(unused)] #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Default)] diff --git a/src/layout/layout.rs b/src/layout/layout.rs index 44d227ac..72f71d1c 100644 --- a/src/layout/layout.rs +++ b/src/layout/layout.rs @@ -1077,8 +1077,6 @@ mod strengths { #[cfg(test)] mod tests { - use std::iter; - use super::*; #[test] diff --git a/src/layout/rect/iter.rs b/src/layout/rect/iter.rs index 794797c8..3b34d471 100644 --- a/src/layout/rect/iter.rs +++ b/src/layout/rect/iter.rs @@ -112,7 +112,6 @@ impl Iterator for Positions { #[cfg(test)] mod tests { use super::*; - use crate::layout::Position; #[test] fn rows() { diff --git a/src/terminal/frame.rs b/src/terminal/frame.rs index cfad6e75..2e09fcdc 100644 --- a/src/terminal/frame.rs +++ b/src/terminal/frame.rs @@ -1,4 +1,4 @@ -use crate::{prelude::*, widgets::WidgetRef}; +use crate::prelude::*; /// A consistent view into the terminal state for rendering a single frame. /// diff --git a/src/text/span.rs b/src/text/span.rs index ec3b9896..1eb8b750 100644 --- a/src/text/span.rs +++ b/src/text/span.rs @@ -514,7 +514,7 @@ mod tests { mod widget { use super::*; - use crate::{assert_buffer_eq, style::Stylize}; + use crate::assert_buffer_eq; #[test] fn render() { diff --git a/src/text/text.rs b/src/text/text.rs index ccbcbe52..abd61c7e 100644 --- a/src/text/text.rs +++ b/src/text/text.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; use itertools::{Itertools, Position}; -use crate::{prelude::*, widgets::Widget}; +use crate::prelude::*; /// A string split over multiple lines where each line is composed of several clusters, each with /// their own style. @@ -503,7 +503,6 @@ mod tests { use rstest::{fixture, rstest}; use super::*; - use crate::style::Stylize; #[test] fn raw() { @@ -754,7 +753,7 @@ mod tests { mod widget { use super::*; - use crate::{assert_buffer_eq, style::Color}; + use crate::assert_buffer_eq; #[test] fn render() { diff --git a/src/widgets/block.rs b/src/widgets/block.rs index 0aa2573f..61e9e5b5 100644 --- a/src/widgets/block.rs +++ b/src/widgets/block.rs @@ -866,11 +866,7 @@ mod tests { use strum::ParseError; use super::*; - use crate::{ - assert_buffer_eq, - layout::{Alignment, Rect}, - style::{Color, Modifier, Stylize}, - }; + use crate::assert_buffer_eq; #[test] fn create_with_all_borders() { diff --git a/src/widgets/calendar.rs b/src/widgets/calendar.rs index 98e8c380..094a4cfd 100644 --- a/src/widgets/calendar.rs +++ b/src/widgets/calendar.rs @@ -248,7 +248,6 @@ mod tests { use time::Month; use super::*; - use crate::style::Color; #[test] fn event_store() { diff --git a/src/widgets/canvas.rs b/src/widgets/canvas.rs index dda9ca26..8325e5df 100644 --- a/src/widgets/canvas.rs +++ b/src/widgets/canvas.rs @@ -30,7 +30,7 @@ pub use self::{ points::Points, rectangle::Rectangle, }; -use crate::{prelude::*, symbols, text::Line as TextLine, widgets::Block}; +use crate::{prelude::*, text::Line as TextLine, widgets::Block}; /// Something that can be drawn on a [`Canvas`]. /// @@ -839,7 +839,7 @@ mod tests { use indoc::indoc; use super::*; - use crate::{buffer::Cell, symbols::Marker}; + use crate::buffer::Cell; // helper to test the canvas checks that drawing a vertical and horizontal line // results in the expected output diff --git a/src/widgets/chart.rs b/src/widgets/chart.rs index bfa27440..751d8c52 100644 --- a/src/widgets/chart.rs +++ b/src/widgets/chart.rs @@ -3,11 +3,9 @@ use std::cmp::max; use strum::{Display, EnumString}; use unicode_width::UnicodeWidthStr; -use super::block::BlockExt; use crate::{ layout::Flex, prelude::*, - symbols, widgets::{ canvas::{Canvas, Line as CanvasLine, Points}, Block, Borders, @@ -1103,10 +1101,7 @@ mod tests { use strum::ParseError; use super::*; - use crate::{ - assert_buffer_eq, - style::{Modifier, Stylize}, - }; + use crate::assert_buffer_eq; struct LegendTestCase { chart_area: Rect, diff --git a/src/widgets/gauge.rs b/src/widgets/gauge.rs index e77453b1..8c77b660 100644 --- a/src/widgets/gauge.rs +++ b/src/widgets/gauge.rs @@ -429,7 +429,6 @@ impl<'a> Styled for LineGauge<'a> { #[cfg(test)] mod tests { use super::*; - use crate::style::{Modifier, Stylize}; #[test] #[should_panic] diff --git a/src/widgets/list.rs b/src/widgets/list.rs index eccacdfd..a36af88c 100755 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -1049,13 +1049,7 @@ mod tests { use rstest::rstest; use super::*; - use crate::{ - assert_buffer_eq, - prelude::Alignment, - style::{Color, Modifier, Stylize}, - text::{Line, Span}, - widgets::Borders, - }; + use crate::{assert_buffer_eq, widgets::Borders}; #[test] fn test_list_state_selected() { diff --git a/src/widgets/paragraph.rs b/src/widgets/paragraph.rs index 70f2c108..a8511738 100644 --- a/src/widgets/paragraph.rs +++ b/src/widgets/paragraph.rs @@ -1,6 +1,5 @@ use unicode_width::UnicodeWidthStr; -use super::block::BlockExt; use crate::{ prelude::*, text::StyledGrapheme, @@ -406,10 +405,7 @@ mod test { use super::*; use crate::{ backend::TestBackend, - style::{Color, Modifier, Stylize}, - text::{Line, Span}, widgets::{block::Position, Borders}, - Terminal, }; /// Tests the [`Paragraph`] widget against the expected [`Buffer`] by rendering it onto an equal diff --git a/src/widgets/reflow.rs b/src/widgets/reflow.rs index 8d73d322..abcf7f98 100644 --- a/src/widgets/reflow.rs +++ b/src/widgets/reflow.rs @@ -336,8 +336,6 @@ fn trim_offset(src: &str, mut offset: usize) -> &str { #[cfg(test)] mod test { - use unicode_segmentation::UnicodeSegmentation; - use super::*; use crate::{ style::Style, diff --git a/src/widgets/scrollbar.rs b/src/widgets/scrollbar.rs index 498d1e11..e172470c 100644 --- a/src/widgets/scrollbar.rs +++ b/src/widgets/scrollbar.rs @@ -12,7 +12,6 @@ use std::iter; use strum::{Display, EnumString}; use unicode_width::UnicodeWidthStr; -use super::StatefulWidget; use crate::{prelude::*, symbols::scrollbar::*}; /// A widget to display a scrollbar @@ -619,7 +618,6 @@ mod tests { use rstest::{fixture, rstest}; use strum::ParseError; - use unicode_width::UnicodeWidthStr; use super::*; diff --git a/src/widgets/sparkline.rs b/src/widgets/sparkline.rs index e2b57875..dfc1abdc 100644 --- a/src/widgets/sparkline.rs +++ b/src/widgets/sparkline.rs @@ -225,11 +225,7 @@ mod tests { use strum::ParseError; use super::*; - use crate::{ - assert_buffer_eq, - buffer::Cell, - style::{Color, Modifier, Stylize}, - }; + use crate::{assert_buffer_eq, buffer::Cell}; #[test] fn render_direction_to_string() { diff --git a/src/widgets/table/cell.rs b/src/widgets/table/cell.rs index 30b953fe..77e136fe 100644 --- a/src/widgets/table/cell.rs +++ b/src/widgets/table/cell.rs @@ -165,7 +165,6 @@ impl<'a> Styled for Cell<'a> { #[cfg(test)] mod tests { use super::*; - use crate::style::{Color, Modifier, Style, Stylize}; #[test] fn new() { diff --git a/src/widgets/table/row.rs b/src/widgets/table/row.rs index 1f3202c8..b3e8410c 100644 --- a/src/widgets/table/row.rs +++ b/src/widgets/table/row.rs @@ -257,7 +257,6 @@ mod tests { use std::vec; use super::*; - use crate::style::{Color, Modifier, Style, Stylize}; #[test] fn new() { diff --git a/src/widgets/table/table.rs b/src/widgets/table/table.rs index 4561d7e2..5694b736 100644 --- a/src/widgets/table/table.rs +++ b/src/widgets/table/table.rs @@ -842,12 +842,7 @@ mod tests { use std::vec; use super::*; - use crate::{ - layout::Constraint::*, - style::{Color, Modifier, Style, Stylize}, - text::Line, - widgets::Borders, - }; + use crate::{layout::Constraint::*, style::Style, text::Line, widgets::Borders}; #[test] fn new() { @@ -1006,7 +1001,7 @@ mod tests { #[cfg(test)] mod render { use super::*; - use crate::{assert_buffer_eq, widgets::Borders}; + use crate::assert_buffer_eq; #[test] fn render_empty_area() {