From 75a19344207d52dd445487747998ff4065540f2e Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Fri, 28 Feb 2020 22:27:35 -0500 Subject: [PATCH] rustfmt --- src/app.rs | 2 +- src/app/data_farmer.rs | 2 +- src/app/data_harvester/processes.rs | 6 +++--- src/app/process_killer.rs | 8 ++++---- src/canvas.rs | 20 ++++++++++---------- src/data_conversion.rs | 12 ++++++------ src/main.rs | 8 ++++---- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/app.rs b/src/app.rs index ad5f9c5d..f7de26f0 100644 --- a/src/app.rs +++ b/src/app.rs @@ -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; diff --git a/src/app/data_farmer.rs b/src/app/data_farmer.rs index c32a62d3..6552a8ec 100644 --- a/src/app/data_farmer.rs +++ b/src/app/data_farmer.rs @@ -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; diff --git a/src/app/data_harvester/processes.rs b/src/app/data_harvester/processes.rs index 7b56f32c..027781eb 100644 --- a/src/app/data_harvester/processes.rs +++ b/src/app/data_harvester/processes.rs @@ -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}; diff --git a/src/app/process_killer.rs b/src/app/process_killer.rs index c2712874..d2089aad 100644 --- a/src/app/process_killer.rs +++ b/src/app/process_killer.rs @@ -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}, }, }; diff --git a/src/canvas.rs b/src/canvas.rs index 69d51039..7b543bb0 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -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; diff --git a/src/data_conversion.rs b/src/data_conversion.rs index c1dc2a17..9302eae2 100644 --- a/src/data_conversion.rs +++ b/src/data_conversion.rs @@ -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)] diff --git a/src/main.rs b/src/main.rs index 4e5ffc2b..a4ddad26 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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::*;