Skip to content

Commit 372f759

Browse files
committed
chore: Rust 1.81.0 linting
1 parent 99f05f2 commit 372f759

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/input_handler/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,13 @@ impl InputHandler {
513513
MouseEventKind::ScrollUp => self.previous(),
514514
MouseEventKind::ScrollDown => self.next(),
515515
MouseEventKind::Down(MouseButton::Left) => {
516-
if let Some(header) = self.gui_state.lock().header_intersect(Rect::new(
516+
let header = self.gui_state.lock().header_intersect(Rect::new(
517517
mouse_event.column,
518518
mouse_event.row,
519519
1,
520520
1,
521-
)) {
521+
));
522+
if let Some(header) = header {
522523
self.sort(header);
523524
}
524525

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ async fn main() {
139139
info!("in debug mode\n");
140140
// Debug mode for testing, less pointless now, will display some basic information
141141
while is_running.load(Ordering::SeqCst) {
142-
if let Some(err) = app_data.lock().get_error() {
142+
let err = app_data.lock().get_error();
143+
if let Some(err) = err {
143144
error!("{}", err);
144145
process::exit(1);
145146
}

src/ui/draw_blocks.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ pub fn ports(
294294
app_data: &Arc<Mutex<AppData>>,
295295
max_lens: (usize, usize, usize),
296296
) {
297-
if let Some(ports) = app_data.lock().get_selected_ports() {
297+
let ports = app_data.lock().get_selected_ports();
298+
if let Some(ports) = ports {
298299
let block = Block::default()
299300
.borders(Borders::ALL)
300301
.border_type(BorderType::Rounded)
@@ -344,7 +345,8 @@ pub fn ports(
344345

345346
/// Draw the cpu + mem charts
346347
pub fn chart(f: &mut Frame, area: Rect, app_data: &Arc<Mutex<AppData>>) {
347-
if let Some((cpu, mem)) = app_data.lock().get_chart_data() {
348+
let cpu_mem = app_data.lock().get_chart_data();
349+
if let Some((cpu, mem)) = cpu_mem {
348350
let area = Layout::default()
349351
.direction(Direction::Horizontal)
350352
.constraints(CONSTRAINT_50_50)

src/ui/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ impl Ui {
114114
)?;
115115
disable_raw_mode()?;
116116
self.terminal.clear().ok();
117-
self.terminal
118-
.set_cursor_position(self.cursor_position)?;
117+
self.terminal.set_cursor_position(self.cursor_position)?;
119118
Ok(self.terminal.show_cursor()?)
120119
}
121120

0 commit comments

Comments
 (0)