Skip to content

Commit

Permalink
Upgrade to e-io 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Oct 3, 2023
1 parent 4b6ab52 commit 38b7d64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
11 changes: 0 additions & 11 deletions src/utils/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -107,19 +106,10 @@ where
Ok(copied)
}

pub(crate) fn map_write_err<W>(e: embedded_io::WriteAllError<W>) -> 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<R: Read>(
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 38b7d64

Please sign in to comment.