diff --git a/src/command.rs b/src/command.rs index e329d54..d185977 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1,6 +1,5 @@ use crate::event::EventMessage; use crate::CommandOptions; -use ansi4tui::bytes_to_text; use anyhow::bail; use anyhow::Context; use anyhow::Result; @@ -8,16 +7,13 @@ use crossbeam::channel::Receiver; use crossbeam::channel::Sender; use parking_lot::RwLock; use ropey::Rope; -use std::collections::hash_map::DefaultHasher; use std::sync::Arc; use std::{ io::Write, process::{Command, Stdio}, }; -use tui::widgets::Paragraph; pub type CommandRequest = (Arc>, Arc); -use crate::App; #[derive(Debug)] pub enum CommandCompleted { diff --git a/src/main.rs b/src/main.rs index 1c8cf75..534a63c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -#![allow(dead_code, unused_imports)] +// #![allow(dead_code, unused_imports)] #![warn(clippy::all, clippy::pedantic, clippy::nursery)] #![allow(clippy::module_name_repetitions, clippy::cast_possible_truncation)] @@ -6,10 +6,8 @@ mod command; mod event; mod ui; mod util; -use ansi4tui::bytes_to_text; use anyhow::anyhow; use anyhow::bail; -use anyhow::Context; use anyhow::Result; use command::CommandCompleted; use command::CommandRequest; @@ -25,27 +23,20 @@ use std::fs::File; use std::str::FromStr; use std::{ io::{self, Write}, - process::{Command, Stdio}, sync::Arc, - thread, - time::Duration, }; use tracing::instrument; use tracing::Level; use tracing_subscriber::Layer; use tracing_subscriber::{filter, prelude::*}; -use tui::text::Text; use tui::{ backend::{Backend, CrosstermBackend}, - layout::{Constraint, Direction, Layout, Rect}, - widgets::{Block, Borders, Paragraph, Widget}, - Frame, Terminal, + Terminal, }; -use ui::RenderState; use ui::RenderStates; use crossterm::{ - event::{DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, + event::{Event, KeyCode}, execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; diff --git a/src/ui.rs b/src/ui.rs index a3f92e5..31df110 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -2,38 +2,16 @@ use crate::command; use crate::util; use crate::App; use ansi4tui::bytes_to_text; -use anyhow::anyhow; -use anyhow::bail; -use anyhow::Result; use command::CommandResult; -use crossterm::event::DisableBracketedPaste; -use crossterm::event::EnableBracketedPaste; use ropey::RopeSlice; -use std::cmp::min; -use std::io::Read; -use std::str::FromStr; -use std::{ - io::{self, Write}, - process::{Command, Stdio}, - sync::Arc, - thread, - time::Duration, -}; use tracing::event; use tracing::instrument; use tracing::Level; -use tui::text::Text; use tui::{ - backend::{Backend, CrosstermBackend}, + backend::Backend, layout::{Constraint, Direction, Layout, Rect}, - widgets::{Block, Borders, Paragraph, Widget}, - Frame, Terminal, -}; - -use crossterm::{ - event::{DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, - execute, - terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, + widgets::{Block, Borders, Paragraph}, + Frame, }; #[instrument(skip(f, app))] diff --git a/src/util.rs b/src/util.rs index bdfb0ae..aca2ba0 100644 --- a/src/util.rs +++ b/src/util.rs @@ -2,8 +2,6 @@ use std::collections::hash_map::DefaultHasher; use std::hash::Hash; use std::hash::Hasher; -use ropey::RopeSlice; - pub fn hash_bytes(r: &[u8]) -> u64 { let mut s = DefaultHasher::new(); r.hash(&mut s);