diff --git a/src/top/dashboard.rs b/src/top/dashboard.rs index 7ccaeeb10e2dd..e0570ede5ea4c 100644 --- a/src/top/dashboard.rs +++ b/src/top/dashboard.rs @@ -10,7 +10,7 @@ use crossterm::{ use num_format::{Locale, ToFormattedString}; use number_prefix::NumberPrefix; use ratatui::{ - backend::{Backend, CrosstermBackend}, + backend::CrosstermBackend, layout::{Alignment, Constraint, Layout, Rect}, style::{Color, Modifier, Style}, text::{Line, Span}, @@ -164,12 +164,7 @@ impl<'a> Widgets<'a> { } /// Renders a title and the URL the dashboard is currently connected to. - fn title( - &'a self, - f: &mut Frame, - area: Rect, - connection_status: &ConnectionStatus, - ) { + fn title(&'a self, f: &mut Frame, area: Rect, connection_status: &ConnectionStatus) { let mut text = vec![ Span::from(self.url_string), Span::styled( @@ -195,7 +190,7 @@ impl<'a> Widgets<'a> { /// Renders a components table, showing sources, transforms and sinks in tabular form, with /// statistics pulled from `ComponentsState`, - fn components_table(&self, f: &mut Frame, state: &state::State, area: Rect) { + fn components_table(&self, f: &mut Frame, state: &state::State, area: Rect) { // Header columns let header = HEADER .iter() @@ -301,7 +296,7 @@ impl<'a> Widgets<'a> { } /// Alerts the user to resize the window to view columns - fn components_resize_window(&self, f: &mut Frame, area: Rect) { + fn components_resize_window(&self, f: &mut Frame, area: Rect) { let block = Block::default().borders(Borders::ALL).title("Components"); let w = Paragraph::new("Expand the window to > 80 chars to view metrics") .block(block) @@ -311,7 +306,7 @@ impl<'a> Widgets<'a> { } /// Renders a box showing instructions on how to exit from `vector top`. - fn quit_box(&self, f: &mut Frame, area: Rect) { + fn quit_box(&self, f: &mut Frame, area: Rect) { let text = vec![Line::from("To quit, press ESC or 'q'")]; let block = Block::default() @@ -326,7 +321,7 @@ impl<'a> Widgets<'a> { } /// Draw a single frame. Creates a layout and renders widgets into it. - fn draw(&self, f: &mut Frame, state: state::State) { + fn draw(&self, f: &mut Frame, state: state::State) { let size = f.size(); let rects = Layout::default() .constraints(self.constraints.clone())