diff --git a/embassy/src/io/util/mod.rs b/embassy/src/io/util/mod.rs index a0bda6e3..a9a00f80 100644 --- a/embassy/src/io/util/mod.rs +++ b/embassy/src/io/util/mod.rs @@ -127,7 +127,10 @@ pub trait AsyncBufReadExt: AsyncBufRead { impl AsyncBufReadExt for R {} -pub async fn read_line(r: &mut R, buf: &mut [u8]) -> Result { +pub async fn read_line( + r: &mut R, + buf: &mut [u8], +) -> Result { r.skip_while(|b| b == b'\r' || b == b'\n').await?; let n = r.read_while(buf, |b| b != b'\r' && b != b'\n').await?; r.skip_while(|b| b == b'\r').await?;