chore: format.
4 files changed, 18 insertions(+), 14 deletions(-)
@@ -4,8 +4,11 @@
path::PathBuf,
};
use ron::{de::{self}, ser::PrettyConfig};
use ron::ser::{self};
use ron::{
de::{self},
ser::PrettyConfig,
};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
@@ -19,7 +19,7 @@
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all
run: cargo fmt --all -- --check
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
@@ -76,7 +76,7 @@
// Cursor position x
let cx = input_chunks[0].x + input.cx as u16;
// cx_max = position + width - 1 (so the cursor does overlap on eye icon)
let cx_max = input_chunks[0].x + input_chunks[0].width.saturating_sub(1);
// cx_max = position + width - 1 (so the cursor does overlap on eye icon)
let cx_max = input_chunks[0].x + input_chunks[0].width.saturating_sub(1);
f.set_cursor_position(layout::Position::new(cx.min(cx_max), input_chunks[0].y))
}
@@ -3,7 +3,11 @@
ui::{self, Margin, list::StatefulList},
};
use ratatui::{
Frame, layout::{Constraint, Flex, Rect}, style::Style, text::Line, widgets::{Block, BorderType, Row, Table}
Frame,
layout::{Constraint, Flex, Rect},
style::Style,
text::Line,
widgets::{Block, BorderType, Row, Table},
};
pub struct TableData<'a, T> {
@@ -39,7 +43,11 @@
Style::new()
};
let table = Table::new(table_data.cells.clone(), table_data.constraint.clone())
.header(Row::new(table_data.header_cols.clone()).style(header_style).bottom_margin(1))
.header(
Row::new(table_data.header_cols.clone())
.style(header_style)
.bottom_margin(1),
)
.block(
Block::bordered()
.title(table_data.title)
@@ -221,14 +229,7 @@
.map(|dev| -> Row<'_> {
Row::new(vec![
Line::from(dev.interface.clone()).centered(),
Line::from(
if dev.state.is_enabled() {
"On"
} else {
"Off"
},
)
.centered(),
Line::from(if dev.state.is_enabled() { "On" } else { "Off" }).centered(),
Line::from(format!("{}", dev.state)).centered(),
Line::from(format!("{} MHz", dev.active_frequency_mhz.unwrap_or(0))).centered(),
Line::from(dev.hw_address.to_string()).centered(),