diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3102d1f3..662a42b2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -4,7 +4,7 @@ description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "1.6.9" -rust-version = "1.70.0" +rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 37600b5d..da674b45 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" version = "0.11.2" -rust-version = "1.70.0" +rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "Apache-2.0 OR MIT" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 5c39973e..bfbd21f0 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -44,20 +44,8 @@ pub enum DownloadError { impl From for DownloadError { fn from(err: io::Error) -> Self { - if err.get_ref().is_some() { - let kind = err.kind(); - - let inner = err - .into_inner() - .expect("err.get_ref() returns Some, so err.into_inner() should also return Some"); - - inner - .downcast() - .map(|b| *b) - .unwrap_or_else(|err| DownloadError::Io(io::Error::new(kind, err))) - } else { - DownloadError::Io(err) - } + err.downcast::() + .unwrap_or_else(DownloadError::Io) } } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 49b8ed21..104fd711 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" version = "0.24.0" -rust-version = "1.65.0" +rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index f367299d..80686ef1 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -530,20 +530,8 @@ impl Termination for BinstallError { impl From for BinstallError { fn from(err: io::Error) -> Self { - if err.get_ref().is_some() { - let kind = err.kind(); - - let inner = err - .into_inner() - .expect("err.get_ref() returns Some, so err.into_inner() should also return Some"); - - inner - .downcast() - .map(|b| *b) - .unwrap_or_else(|err| BinstallError::Io(io::Error::new(kind, err))) - } else { - BinstallError::Io(err) - } + err.downcast::() + .unwrap_or_else(BinstallError::Io) } }