Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Oct 1, 2024
1 parent c090486 commit db4cca2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
8 changes: 3 additions & 5 deletions oryx-tui/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ pub fn handle_key_events(
}

if app.editing_block.is_some() {
match key_event.code {
KeyCode::Esc => {
app.editing_block = None;
}
_ => {}
if key_event.code == KeyCode::Esc {
app.editing_block = None
}

app.section.handle_keys(key_event);
return Ok(());
}
Expand Down
4 changes: 2 additions & 2 deletions oryx-tui/src/inspection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ impl Inspection {
let fuzzy = self.fuzzy.lock().unwrap();

if fuzzy.is_enabled() {
return !fuzzy.packets.is_empty();
!fuzzy.packets.is_empty()
} else {
return !packets.is_empty();
!packets.is_empty()
}
}

Expand Down
9 changes: 5 additions & 4 deletions oryx-tui/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ impl Section {
FocusedSection::Alerts => self.focused_section = FocusedSection::Stats,
},

_ => match self.focused_section {
FocusedSection::Inspection => self.inspection.handle_keys(key_event),
_ => {}
},
_ => {
if self.focused_section == FocusedSection::Inspection {
self.inspection.handle_keys(key_event);
}
}
}
}
}

0 comments on commit db4cca2

Please sign in to comment.