From 32c67381df48979f6cf3c188b0dec447d1935d12 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 27 Dec 2020 23:34:05 +0100 Subject: [PATCH] Add missing ?Sized bound in read_line --- embassy/src/io/util/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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?;