refactor: unused_imports (#974)

enabled by default, only detected on nightly yet
This commit is contained in:
EdJoPaTo 2024-03-02 11:27:13 +01:00 committed by Josh McKinney
parent f1398ae6cb
commit df5dddfbc9
No known key found for this signature in database
GPG key ID: 722287396A903BC5
19 changed files with 13 additions and 53 deletions

View file

@ -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)]

View file

@ -1077,8 +1077,6 @@ mod strengths {
#[cfg(test)]
mod tests {
use std::iter;
use super::*;
#[test]

View file

@ -112,7 +112,6 @@ impl Iterator for Positions {
#[cfg(test)]
mod tests {
use super::*;
use crate::layout::Position;
#[test]
fn rows() {

View file

@ -1,4 +1,4 @@
use crate::{prelude::*, widgets::WidgetRef};
use crate::prelude::*;
/// A consistent view into the terminal state for rendering a single frame.
///

View file

@ -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() {

View file

@ -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() {

View file

@ -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() {

View file

@ -248,7 +248,6 @@ mod tests {
use time::Month;
use super::*;
use crate::style::Color;
#[test]
fn event_store() {

View file

@ -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

View file

@ -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,

View file

@ -429,7 +429,6 @@ impl<'a> Styled for LineGauge<'a> {
#[cfg(test)]
mod tests {
use super::*;
use crate::style::{Modifier, Stylize};
#[test]
#[should_panic]

View file

@ -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() {

View file

@ -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

View file

@ -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,

View file

@ -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::*;

View file

@ -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() {

View file

@ -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() {

View file

@ -257,7 +257,6 @@ mod tests {
use std::vec;
use super::*;
use crate::style::{Color, Modifier, Style, Stylize};
#[test]
fn new() {

View file

@ -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() {