Remove unused imports
This commit is contained in:
parent
04fa8381f5
commit
5b47c44e2d
@ -1,6 +1,5 @@
|
|||||||
use crate::event::EventMessage;
|
use crate::event::EventMessage;
|
||||||
use crate::CommandOptions;
|
use crate::CommandOptions;
|
||||||
use ansi4tui::bytes_to_text;
|
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
@ -8,16 +7,13 @@ use crossbeam::channel::Receiver;
|
|||||||
use crossbeam::channel::Sender;
|
use crossbeam::channel::Sender;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use ropey::Rope;
|
use ropey::Rope;
|
||||||
use std::collections::hash_map::DefaultHasher;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::{
|
use std::{
|
||||||
io::Write,
|
io::Write,
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
};
|
};
|
||||||
use tui::widgets::Paragraph;
|
|
||||||
|
|
||||||
pub type CommandRequest = (Arc<RwLock<CommandOptions>>, Arc<String>);
|
pub type CommandRequest = (Arc<RwLock<CommandOptions>>, Arc<String>);
|
||||||
use crate::App;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum CommandCompleted {
|
pub enum CommandCompleted {
|
||||||
|
15
src/main.rs
15
src/main.rs
@ -1,4 +1,4 @@
|
|||||||
#![allow(dead_code, unused_imports)]
|
// #![allow(dead_code, unused_imports)]
|
||||||
#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
|
#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
|
||||||
#![allow(clippy::module_name_repetitions, clippy::cast_possible_truncation)]
|
#![allow(clippy::module_name_repetitions, clippy::cast_possible_truncation)]
|
||||||
|
|
||||||
@ -6,10 +6,8 @@ mod command;
|
|||||||
mod event;
|
mod event;
|
||||||
mod ui;
|
mod ui;
|
||||||
mod util;
|
mod util;
|
||||||
use ansi4tui::bytes_to_text;
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use anyhow::Context;
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use command::CommandCompleted;
|
use command::CommandCompleted;
|
||||||
use command::CommandRequest;
|
use command::CommandRequest;
|
||||||
@ -25,27 +23,20 @@ use std::fs::File;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::{
|
use std::{
|
||||||
io::{self, Write},
|
io::{self, Write},
|
||||||
process::{Command, Stdio},
|
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
thread,
|
|
||||||
time::Duration,
|
|
||||||
};
|
};
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
use tracing_subscriber::Layer;
|
use tracing_subscriber::Layer;
|
||||||
use tracing_subscriber::{filter, prelude::*};
|
use tracing_subscriber::{filter, prelude::*};
|
||||||
use tui::text::Text;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::{Backend, CrosstermBackend},
|
backend::{Backend, CrosstermBackend},
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
Terminal,
|
||||||
widgets::{Block, Borders, Paragraph, Widget},
|
|
||||||
Frame, Terminal,
|
|
||||||
};
|
};
|
||||||
use ui::RenderState;
|
|
||||||
use ui::RenderStates;
|
use ui::RenderStates;
|
||||||
|
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
|
event::{Event, KeyCode},
|
||||||
execute,
|
execute,
|
||||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
||||||
};
|
};
|
||||||
|
28
src/ui.rs
28
src/ui.rs
@ -2,38 +2,16 @@ use crate::command;
|
|||||||
use crate::util;
|
use crate::util;
|
||||||
use crate::App;
|
use crate::App;
|
||||||
use ansi4tui::bytes_to_text;
|
use ansi4tui::bytes_to_text;
|
||||||
use anyhow::anyhow;
|
|
||||||
use anyhow::bail;
|
|
||||||
use anyhow::Result;
|
|
||||||
use command::CommandResult;
|
use command::CommandResult;
|
||||||
use crossterm::event::DisableBracketedPaste;
|
|
||||||
use crossterm::event::EnableBracketedPaste;
|
|
||||||
use ropey::RopeSlice;
|
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::event;
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
use tui::text::Text;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::{Backend, CrosstermBackend},
|
backend::Backend,
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
layout::{Constraint, Direction, Layout, Rect},
|
||||||
widgets::{Block, Borders, Paragraph, Widget},
|
widgets::{Block, Borders, Paragraph},
|
||||||
Frame, Terminal,
|
Frame,
|
||||||
};
|
|
||||||
|
|
||||||
use crossterm::{
|
|
||||||
event::{DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
|
|
||||||
execute,
|
|
||||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[instrument(skip(f, app))]
|
#[instrument(skip(f, app))]
|
||||||
|
@ -2,8 +2,6 @@ use std::collections::hash_map::DefaultHasher;
|
|||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::hash::Hasher;
|
use std::hash::Hasher;
|
||||||
|
|
||||||
use ropey::RopeSlice;
|
|
||||||
|
|
||||||
pub fn hash_bytes(r: &[u8]) -> u64 {
|
pub fn hash_bytes(r: &[u8]) -> u64 {
|
||||||
let mut s = DefaultHasher::new();
|
let mut s = DefaultHasher::new();
|
||||||
r.hash(&mut s);
|
r.hash(&mut s);
|
||||||
|
Loading…
Reference in New Issue
Block a user