Skip to content

Commit

Permalink
[Clippy] Remove unneeded 'return' statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJuliusMartinez committed Feb 9, 2022
1 parent 2f635c3 commit 2a53257
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<const N: usize> BufferedInput<N> {
return true;
}

return false;
false
}

fn read_more_if_needed(&mut self) -> Option<io::Error> {
Expand Down Expand Up @@ -172,16 +172,14 @@ impl TuiInput {
}

match self.buffered_input.next() {
Some(Ok(byte)) => {
return match parse_event(byte, &mut self.buffered_input) {
Ok(Event::Key(k)) => Some(Ok(TuiEvent::KeyEvent(k))),
Ok(Event::Mouse(m)) => Some(Ok(TuiEvent::MouseEvent(m))),
Ok(Event::Unsupported(_)) => Some(Ok(TuiEvent::Unknown)),
Err(err) => Some(Err(err)),
};
}
Some(Err(err)) => return Some(Err(err)),
None => return None,
Some(Ok(byte)) => match parse_event(byte, &mut self.buffered_input) {
Ok(Event::Key(k)) => Some(Ok(TuiEvent::KeyEvent(k))),
Ok(Event::Mouse(m)) => Some(Ok(TuiEvent::MouseEvent(m))),
Ok(Event::Unsupported(_)) => Some(Ok(TuiEvent::Unknown)),
Err(err) => Some(Err(err)),
},
Some(Err(err)) => Some(Err(err)),
None => None,
}
}
}
Expand Down Expand Up @@ -224,7 +222,7 @@ impl Iterator for TuiInput {
return Some(Ok(TuiEvent::WinChEvent));
}

return self.get_event_from_buffered_input();
self.get_event_from_buffered_input()
}
}

Expand Down

0 comments on commit 2a53257

Please sign in to comment.