Skip to content

Commit

Permalink
Switch to binrw from unmaintained binread
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-gilligan authored and jessebraham committed Sep 18, 2023
1 parent 28fab99 commit 1c75bce
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
26 changes: 17 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion espflash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ required-features = ["cli"]
[dependencies]
addr2line = { version = "0.20.0", optional = true }
base64 = "0.21.2"
binread = "2.2.0"
binrw = "0.11.2"
bytemuck = { version = "1.13.1", features = ["derive"] }
clap = { version = "4.3.*", features = ["derive", "env", "wrap_help"], optional = true }
clap_complete = { version = "4.3.*", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion espflash/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use std::{io::BufWriter, thread::sleep, time::Duration};

use binread::{io::Cursor, BinRead, BinReaderExt};
use binrw::{io::Cursor, BinRead, BinReaderExt};
use log::info;
use serialport::UsbPortInfo;
use slip_codec::SlipDecoder;
Expand Down
10 changes: 5 additions & 5 deletions espflash/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ impl From<io::Error> for Error {
}
}

impl From<binread::Error> for Error {
fn from(err: binread::Error) -> Self {
impl From<binrw::Error> for Error {
fn from(err: binrw::Error) -> Self {
Self::Connection(err.into())
}
}
Expand Down Expand Up @@ -223,10 +223,10 @@ impl From<io::Error> for ConnectionError {
}
}

impl From<binread::Error> for ConnectionError {
fn from(err: binread::Error) -> Self {
impl From<binrw::Error> for ConnectionError {
fn from(err: binrw::Error) -> Self {
match err {
binread::Error::Io(e) => ConnectionError::from(e),
binrw::Error::Io(e) => ConnectionError::from(e),
_ => unreachable!(),
}
}
Expand Down

0 comments on commit 1c75bce

Please sign in to comment.