Skip to content

Commit

Permalink
chore: Rust 1.81.0 linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Sep 5, 2024
1 parent 99f05f2 commit 372f759
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/input_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 4 additions & 2 deletions src/ui/draw_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?)
}

Expand Down

0 comments on commit 372f759

Please # to comment.