mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-22 04:03:06 +00:00
rustfmt
This commit is contained in:
parent
520af2b68f
commit
75a1934420
7 changed files with 29 additions and 29 deletions
|
@ -8,8 +8,8 @@ use data_harvester::{processes, temperature};
|
|||
|
||||
use crate::{canvas, constants, utils::error::Result};
|
||||
|
||||
pub mod data_harvester;
|
||||
pub mod data_farmer;
|
||||
pub mod data_harvester;
|
||||
mod process_killer;
|
||||
|
||||
const MAX_SEARCH_LENGTH: usize = 200;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
use std::time::Instant;
|
||||
use std::vec::Vec;
|
||||
|
||||
use crate::data_harvester::{cpu, Data, disks, mem, network, processes, temperature};
|
||||
use crate::data_harvester::{cpu, disks, mem, network, processes, temperature, Data};
|
||||
|
||||
pub type TimeOffset = f64;
|
||||
pub type Value = f64;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::{
|
||||
collections::{hash_map::RandomState, HashMap},
|
||||
process::Command,
|
||||
time::Instant,
|
||||
collections::{hash_map::RandomState, HashMap},
|
||||
process::Command,
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use sysinfo::{ProcessExt, ProcessorExt, System, SystemExt};
|
||||
|
|
|
@ -3,10 +3,10 @@ use std::process::Command;
|
|||
// Copied from SO: https://stackoverflow.com/a/55231715
|
||||
#[cfg(target_os = "windows")]
|
||||
use winapi::{
|
||||
shared::{minwindef::DWORD, ntdef::HANDLE},
|
||||
um::{
|
||||
processthreadsapi::{OpenProcess, TerminateProcess},
|
||||
winnt::{PROCESS_QUERY_INFORMATION, PROCESS_TERMINATE},
|
||||
shared::{minwindef::DWORD, ntdef::HANDLE},
|
||||
um::{
|
||||
processthreadsapi::{OpenProcess, TerminateProcess},
|
||||
winnt::{PROCESS_QUERY_INFORMATION, PROCESS_TERMINATE},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ use std::cmp::max;
|
|||
use std::collections::HashMap;
|
||||
|
||||
use tui::{
|
||||
backend,
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||
style::{Color, Style},
|
||||
Terminal,
|
||||
terminal::Frame,
|
||||
widgets::{Axis, Block, Borders, Chart, Dataset, Marker, Paragraph, Row, Table, Text, Widget},
|
||||
backend,
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||
style::{Color, Style},
|
||||
terminal::Frame,
|
||||
widgets::{Axis, Block, Borders, Chart, Dataset, Marker, Paragraph, Row, Table, Text, Widget},
|
||||
Terminal,
|
||||
};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
@ -16,10 +16,10 @@ use canvas_colours::*;
|
|||
use drawing_utils::*;
|
||||
|
||||
use crate::{
|
||||
app::{self, data_harvester::processes::ProcessHarvest, WidgetPosition},
|
||||
constants::*,
|
||||
data_conversion::{ConvertedCpuData, ConvertedProcessData},
|
||||
utils::error,
|
||||
app::{self, data_harvester::processes::ProcessHarvest, WidgetPosition},
|
||||
constants::*,
|
||||
data_conversion::{ConvertedCpuData, ConvertedProcessData},
|
||||
utils::error,
|
||||
};
|
||||
|
||||
mod canvas_colours;
|
||||
|
|
|
@ -6,13 +6,13 @@ use std::collections::HashMap;
|
|||
use constants::*;
|
||||
|
||||
use crate::{
|
||||
app::{
|
||||
App,
|
||||
data_farmer,
|
||||
data_harvester::{self, processes::ProcessHarvest},
|
||||
app::{
|
||||
data_farmer,
|
||||
data_harvester::{self, processes::ProcessHarvest},
|
||||
App,
|
||||
},
|
||||
constants,
|
||||
utils::gen_util::{get_exact_byte_values, get_simple_byte_values},
|
||||
constants,
|
||||
utils::gen_util::{get_exact_byte_values, get_simple_byte_values},
|
||||
};
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
|
|
|
@ -20,20 +20,20 @@ use std::{
|
|||
|
||||
use crossterm::{
|
||||
event::{
|
||||
DisableMouseCapture, EnableMouseCapture, Event as CEvent, KeyCode, KeyEvent, KeyModifiers, MouseEvent,
|
||||
poll, read,
|
||||
poll, read, DisableMouseCapture, EnableMouseCapture, Event as CEvent, KeyCode, KeyEvent,
|
||||
KeyModifiers, MouseEvent,
|
||||
},
|
||||
execute,
|
||||
style::Print,
|
||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen},
|
||||
terminal::LeaveAlternateScreen,
|
||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use tui::{backend::CrosstermBackend, Terminal};
|
||||
|
||||
use app::{
|
||||
App,
|
||||
data_harvester::{self, processes::ProcessSorting},
|
||||
App,
|
||||
};
|
||||
use constants::*;
|
||||
use data_conversion::*;
|
||||
|
|
Loading…
Reference in a new issue