Skip to content

Commit da4280e

Browse files
committed
embedded: Upgrade to embedded-hal 1.0.0-alpha.7
1 parent 0cd0c4d commit da4280e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ features = [
3939

4040
[dependencies]
4141
serde = { version = "1.0", features = ["derive"], optional = true }
42-
embedded-hal = { version = "=1.0.0-alpha.6", optional = true }
42+
embedded-hal = { version = "=1.0.0-alpha.7", optional = true }
4343
nb = { version = "1", optional = true }
4444

4545
[dev-dependencies]

src/embedded.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct SerialError {
1313
kind: io::ErrorKind,
1414
}
1515

16-
// Implement serial::Error for SerialError
16+
// Implement `serial::Error` for SerialError
1717
impl serial::Error for SerialError {
1818
fn kind(&self) -> serial::ErrorKind {
1919
#[allow(clippy::match_single_binding)]
@@ -30,9 +30,11 @@ fn io_error_to_nb(err: io::Error) -> nb::Error<SerialError> {
3030
}
3131
}
3232

33-
impl serial::nb::Read<u8> for Box<dyn SerialPort> {
33+
impl serial::ErrorType for Box<dyn SerialPort> {
3434
type Error = SerialError;
35+
}
3536

37+
impl serial::nb::Read<u8> for Box<dyn SerialPort> {
3638
fn read(&mut self) -> nb::Result<u8, Self::Error> {
3739
let mut buffer = [0; 1];
3840
let bytes_read = io::Read::read(self, &mut buffer).map_err(io_error_to_nb)?;
@@ -45,8 +47,6 @@ impl serial::nb::Read<u8> for Box<dyn SerialPort> {
4547
}
4648

4749
impl serial::nb::Write<u8> for Box<dyn SerialPort> {
48-
type Error = SerialError;
49-
5050
fn write(&mut self, word: u8) -> nb::Result<(), Self::Error> {
5151
io::Write::write(self, &[word])
5252
.map_err(io_error_to_nb)

0 commit comments

Comments
 (0)