use Duration::ZERO when reading times out

This commit is contained in:
Vladan Popovic 2022-06-22 14:34:09 +02:00
parent 10c61f5d78
commit f0d474d062

View file

@ -85,7 +85,7 @@ impl<UART: serial::Uart> Iterator for RxIter<UART> {
}, },
Err(_) => { Err(_) => {
if start.elapsed() > self.timeout { if start.elapsed() > self.timeout {
self.timeout = Duration::from_millis(0); self.timeout = Duration::ZERO;
break None break None
} }
thread::sleep(Duration::from_millis(200)); thread::sleep(Duration::from_millis(200));