From 38b7d64c529731e1a2c28152d94c1b08f2e68ac3 Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Tue, 3 Oct 2023 19:27:51 +0000 Subject: [PATCH] Upgrade to e-io 0.6 --- Cargo.toml | 4 ++-- src/utils/io.rs | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d60ebcb..be76e36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,8 @@ defmt = ["dep:defmt", "heapless/defmt", "heapless/defmt-impl", "embedded-io/defm [dependencies] heapless = { version = "0.7" } -embedded-io = { version = "0.5", default-features = false } -embedded-io-async = { version = "0.5", default-features = false, optional = true } +embedded-io = { version = "0.6", default-features = false } +embedded-io-async = { version = "0.6", default-features = false, optional = true } embedded-hal-async = { version = "=1.0.0-rc.1", default-features = false, optional = true } log = { version = "0.4", default-features = false, optional = true } no-std-net = { version = "0.5", default-features = false } diff --git a/src/utils/io.rs b/src/utils/io.rs index b120d6f..fa20a00 100644 --- a/src/utils/io.rs +++ b/src/utils/io.rs @@ -95,7 +95,6 @@ where write .write_all(&buf[0..size_read]) - .map_err(map_write_err) .map_err(CopyError::Write)?; copied += size_read as u64; @@ -107,19 +106,10 @@ where Ok(copied) } -pub(crate) fn map_write_err(e: embedded_io::WriteAllError) -> W { - match e { - embedded_io::WriteAllError::WriteZero => panic!("write() returned Ok(0)"), - embedded_io::WriteAllError::Other(e) => e, - } -} - #[cfg(feature = "nightly")] pub mod asynch { use crate::io::asynch::{Read, Write}; - use super::map_write_err; - pub use super::CopyError; pub async fn try_read_full( @@ -193,7 +183,6 @@ pub mod asynch { write .write_all(&buf[0..size_read]) .await - .map_err(map_write_err) .map_err(CopyError::Write)?; copied += size_read as u64;