summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2019-10-17 21:39:59 +0200
committerAram Drevekenin <aram@poor.dev>2019-10-17 21:39:59 +0200
commitb6eda322be7a0f9f7d30f662578d5e236d167f82 (patch)
treee2d9e647512497fd7282b78e9d9708fb79a6741c /src/tests
parent50b4e6471eef5400158071b156b4a3faeba29063 (diff)
style(lint): rustfmt + clippy
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/fakes/fake_input.rs39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/tests/fakes/fake_input.rs b/src/tests/fakes/fake_input.rs
index 1cd5fa4..831d4fb 100644
--- a/src/tests/fakes/fake_input.rs
+++ b/src/tests/fakes/fake_input.rs
@@ -22,15 +22,13 @@ impl Iterator for KeyboardEvents {
type Item = Event;
fn next(&mut self) -> Option<Event> {
match self.events.pop() {
- Some(ev) => {
- match ev {
- Some(ev) => Some(ev),
- None => {
- thread::sleep(time::Duration::from_secs(1));
- self.next()
- }
+ Some(ev) => match ev {
+ Some(ev) => Some(ev),
+ None => {
+ thread::sleep(time::Duration::from_secs(1));
+ self.next()
}
- }
+ },
None => None,
}
}
@@ -61,23 +59,18 @@ impl DataLinkReceiver for NetworkFrames {
// this is so the tests pass consistently
thread::sleep(time::Duration::from_millis(500));
}
- match self.current_index < self.packets.len() {
- true => {
- let action = self.next_packet();
- match action {
- Some(packet) => {
- Ok(&packet[..])
- }
- None => {
- thread::sleep(time::Duration::from_secs(1));
- Ok(&[][..])
- }
+ if self.current_index < self.packets.len() {
+ let action = self.next_packet();
+ match action {
+ Some(packet) => Ok(&packet[..]),
+ None => {
+ thread::sleep(time::Duration::from_secs(1));
+ Ok(&[][..])
}
}
- false => {
- thread::sleep(time::Duration::from_secs(1));
- Ok(&[][..])
- }
+ } else {
+ thread::sleep(time::Duration::from_secs(1));
+ Ok(&[][..])
}
}
}