Skip to content

Commit bcbcf5c

Browse files
committed
Clippy fixes
1 parent 7989bb0 commit bcbcf5c

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,8 @@ impl App {
475475
self.exec_continuation(AppEvent::Run).await;
476476
}
477477
AppEvent::ContextDepth(inc) => {
478-
let depth = self.context_depth.clone();
479-
self.context_depth = depth.wrapping_add(inc as u16).max(1).min(9);
478+
let depth = self.context_depth;
479+
self.context_depth = depth.wrapping_add(inc as u16).clamp(1, 9);
480480
self.client
481481
.lock()
482482
.await

src/dbgp/client.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ impl Properties {
6868
}
6969

7070
pub(crate) fn get(&self, name: &str) -> Option<&Property> {
71-
for property in self.defined_properties() {
72-
if property.name == name {
73-
return Some(property);
74-
}
75-
}
76-
None
71+
self.defined_properties().into_iter().find(|&property| property.name == name).map(|v| v as _)
7772
}
7873

7974
pub fn from_properties(vec: Vec<Property>) -> Properties {

src/view/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn notification_widget(app: &App) -> Paragraph<'_> {
7373
.alignment(ratatui::layout::Alignment::Right)])
7474
}
7575

76-
fn status_widget(app: &App) -> Paragraph {
76+
fn status_widget<'a>(app: &'a App) -> Paragraph<'a> {
7777
Paragraph::new(vec![Line::from(vec![
7878
Span::styled(
7979
format!(

src/view/session.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use super::Pane;
99
use super::View;
1010
use crate::app::App;
1111
use crate::app::ListenStatus;
12-
use crate::app::SelectedView;
1312
use crate::event::input::AppEvent;
1413
use crossterm::event::KeyCode;
1514
use crossterm::event::KeyModifiers;
@@ -47,10 +46,10 @@ impl View for SessionView {
4746
KeyCode::Tab => return Some(AppEvent::NextPane),
4847
KeyCode::BackTab => return Some(AppEvent::PreviousPane),
4948
KeyCode::Enter => return Some(AppEvent::ToggleFullscreen),
50-
KeyCode::Left => return Some(AppEvent::Scroll((0, -1 * multiplier))),
51-
KeyCode::Right => return Some(AppEvent::Scroll((0, 1 * multiplier))),
52-
KeyCode::Up => return Some(AppEvent::Scroll((-1 * multiplier, 0))),
53-
KeyCode::Down => return Some(AppEvent::Scroll((1 * multiplier, 0))),
49+
KeyCode::Left => return Some(AppEvent::Scroll((0, -multiplier))),
50+
KeyCode::Right => return Some(AppEvent::Scroll((0, multiplier))),
51+
KeyCode::Up => return Some(AppEvent::Scroll((-multiplier, 0))),
52+
KeyCode::Down => return Some(AppEvent::Scroll((multiplier, 0))),
5453
KeyCode::Char(char) => match char {
5554
'e' => return Some(AppEvent::EvalStart),
5655
'j' => return Some(AppEvent::Scroll((1, 0))),

0 commit comments

Comments
 (0)