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
1 changed files with 1 additions and 1 deletions

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));