Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ impl OrderedReceiver {
self.next = self.buffer.keys().next().copied();
}

if let Some(next) = self.next {
if let Some(entry) = self.buffer.remove(&next) {
self.next = Some(next + 1);
return Ok(entry);
}
if let Some(next) = self.next
&& let Some(entry) = self.buffer.remove(&next)
{
self.next = Some(next + 1);
return Ok(entry);
}

// soft-fail protection
Expand Down
34 changes: 17 additions & 17 deletions src/plugins/dbg_ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,25 @@ impl CorePlugin for DbgUI {
}

loop {
if let Ok(Some(line)) = lines.next_line().await {
if let Ok(idx) = line.trim().parse::<usize>() {
if let Some(chosen) = items.get(idx) {
println!("You chose: {}", chosen);
if let Ok(Some(line)) = lines.next_line().await
&& let Ok(idx) = line.trim().parse::<usize>()
{
if let Some(chosen) = items.get(idx) {
println!("You chose: {}", chosen);

let option = echo_senders.get(&label);
if let Some(sender) = option {
let _ = sender
.send(Echo::Choose(vec![idx]))
.await;
}

break;
} else {
println!(
"{}",
"Invalid index, try again".bright_red()
);
let option = echo_senders.get(&label);
if let Some(sender) = option {
let _ = sender
.send(Echo::Choose(vec![idx]))
.await;
}

break;
} else {
println!(
"{}",
"Invalid index, try again".bright_red()
);
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/plugins/tui/components/json_navigator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,22 @@

match event.code {
KeyCode::Up => {
if self.nav_active {
if self.nav_active && {
moved = self.cursor.step_backward().is_some();
if !moved {
self.json_scroll = self.json_scroll.saturating_sub(1);
self.hex_scroll = self.hex_scroll.saturating_sub(1);
}
!moved
} {
self.json_scroll = self.json_scroll.saturating_sub(1);
self.hex_scroll = self.hex_scroll.saturating_sub(1);
}

Check warning

Code scanning / clippy

this if can be collapsed into the outer match Warning

this if can be collapsed into the outer match
}
KeyCode::Down => {
if self.nav_active {
if self.nav_active && {
moved = self.cursor.step_forward().is_some();
if !moved {
self.json_scroll = self.json_scroll.saturating_add(1);
self.hex_scroll = self.hex_scroll.saturating_add(1);
}
!moved
} {
self.json_scroll = self.json_scroll.saturating_add(1);
self.hex_scroll = self.hex_scroll.saturating_add(1);
}

Check warning

Code scanning / clippy

this if can be collapsed into the outer match Warning

this if can be collapsed into the outer match
}
KeyCode::Left => {
if self.cursor.is_at_root() {
Expand Down
Loading