diff --git a/src/modem.rs b/src/modem.rs index 7fabae3..700c166 100644 --- a/src/modem.rs +++ b/src/modem.rs @@ -11,7 +11,7 @@ use esp_idf_hal::serial::{self, Rx, Tx}; pub type Result = std::result::Result; pub struct Modem { - rx: IterableRx, + rx: RxIter, tx: Tx, } @@ -32,12 +32,12 @@ impl std::fmt::Display for ModemError { } } -pub struct IterableRx { +pub struct RxIter { inner: Rx, timeout: Duration, } -impl IterableRx { +impl RxIter { fn reset(&mut self, timeout: Duration) -> &mut Self { self.timeout = timeout; self @@ -69,7 +69,7 @@ impl IterableRx { } } -impl Iterator for IterableRx { +impl Iterator for RxIter { type Item = u8; /// `nb` returns Ok(byte), or one of Err(WouldBlock) and Err(Other) which isn't of anyone's @@ -98,7 +98,7 @@ impl Iterator for IterableRx { impl Modem { pub fn new(tx: Tx, rx: Rx) -> Self { Self { - rx: IterableRx { inner: rx, timeout: Duration::from_millis(0) }, + rx: RxIter { inner: rx, timeout: Duration::from_millis(0) }, tx, } }