chore: Rust 1.81.0 linting

This commit is contained in:
Jack Wills
2024-09-05 20:50:54 +00:00
parent 99f05f2e5b
commit 372f759ca4
4 changed files with 10 additions and 7 deletions
+3 -2
View File
@@ -513,12 +513,13 @@ impl InputHandler {
MouseEventKind::ScrollUp => self.previous(),
MouseEventKind::ScrollDown => self.next(),
MouseEventKind::Down(MouseButton::Left) => {
if let Some(header) = self.gui_state.lock().header_intersect(Rect::new(
let header = self.gui_state.lock().header_intersect(Rect::new(
mouse_event.column,
mouse_event.row,
1,
1,
)) {
));
if let Some(header) = header {
self.sort(header);
}
+2 -1
View File
@@ -139,7 +139,8 @@ async fn main() {
info!("in debug mode\n");
// Debug mode for testing, less pointless now, will display some basic information
while is_running.load(Ordering::SeqCst) {
if let Some(err) = app_data.lock().get_error() {
let err = app_data.lock().get_error();
if let Some(err) = err {
error!("{}", err);
process::exit(1);
}
+4 -2
View File
@@ -294,7 +294,8 @@ pub fn ports(
app_data: &Arc<Mutex<AppData>>,
max_lens: (usize, usize, usize),
) {
if let Some(ports) = app_data.lock().get_selected_ports() {
let ports = app_data.lock().get_selected_ports();
if let Some(ports) = ports {
let block = Block::default()
.borders(Borders::ALL)
.border_type(BorderType::Rounded)
@@ -344,7 +345,8 @@ pub fn ports(
/// Draw the cpu + mem charts
pub fn chart(f: &mut Frame, area: Rect, app_data: &Arc<Mutex<AppData>>) {
if let Some((cpu, mem)) = app_data.lock().get_chart_data() {
let cpu_mem = app_data.lock().get_chart_data();
if let Some((cpu, mem)) = cpu_mem {
let area = Layout::default()
.direction(Direction::Horizontal)
.constraints(CONSTRAINT_50_50)
+1 -2
View File
@@ -114,8 +114,7 @@ impl Ui {
)?;
disable_raw_mode()?;
self.terminal.clear().ok();
self.terminal
.set_cursor_position(self.cursor_position)?;
self.terminal.set_cursor_position(self.cursor_position)?;
Ok(self.terminal.show_cursor()?)
}