Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion embedded-hal-nb/src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
let _ = s
.bytes()
.map(|c| nb::block!(self.write(Word::from(c))))
.last();
.next_back();
Ok(())
}
}
1 change: 1 addition & 0 deletions embedded-io/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `core::error::Error` implementations for every custom `impl Error`
- Migrated `std` feature-gated `std::error::Error` implementations to `core::error::Error`
- Increased MSRV to 1.81 due to `core::error::Error`
- Implemented `ReadReady` for `&[u8]` and `WriteReady` for `&mut [u8]`

## 0.6.1 - 2023-10-22

Expand Down
9 changes: 8 additions & 1 deletion embedded-io/src/impls/slice_mut.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Error, ErrorKind, ErrorType, SliceWriteError, Write};
use crate::{Error, ErrorKind, ErrorType, SliceWriteError, Write, WriteReady};
use core::mem;

impl Error for SliceWriteError {
Expand Down Expand Up @@ -47,3 +47,10 @@ impl Write for &mut [u8] {
Ok(())
}
}

impl WriteReady for &mut [u8] {
#[inline]
fn write_ready(&mut self) -> Result<bool, Self::Error> {
Ok(true)
}
}
9 changes: 8 additions & 1 deletion embedded-io/src/impls/slice_ref.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BufRead, ErrorType, Read};
use crate::{BufRead, ErrorType, Read, ReadReady};

impl ErrorType for &[u8] {
type Error = core::convert::Infallible;
Expand Down Expand Up @@ -39,3 +39,10 @@ impl BufRead for &[u8] {
*self = &self[amt..];
}
}

impl ReadReady for &[u8] {
#[inline]
fn read_ready(&mut self) -> Result<bool, Self::Error> {
Ok(true)
}
}