From a5d21dc8a826bd02a159095dbc35c90d99c672d9 Mon Sep 17 00:00:00 2001 From: Christiaan676 <31404228+Christiaan676@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:29:44 +0200 Subject: [PATCH 1/3] Switch to core::error::Error --- .github/workflows/hybrid-array.yml | 6 +++--- Cargo.toml | 2 +- src/iter.rs | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hybrid-array.yml b/.github/workflows/hybrid-array.yml index fedad55..e2bf9cc 100644 --- a/.github/workflows/hybrid-array.yml +++ b/.github/workflows/hybrid-array.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 # MSRV + - 1.81.0 # MSRV - stable target: - armv7a-none-eabi @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.75.0 + toolchain: 1.81.0 components: clippy - run: cargo clippy --all --all-features -- -D warnings @@ -95,7 +95,7 @@ jobs: strategy: matrix: toolchain: - - 1.65.0 # MSRV + - 1.81.0 # MSRV - stable runs-on: ubuntu-latest steps: diff --git a/Cargo.toml b/Cargo.toml index f776f5a..f010dab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ categories = ["no-std", "data-structures"] keywords = ["generic-array"] readme = "README.md" edition = "2021" -rust-version = "1.65" +rust-version = "1.81.0" [dependencies] typenum = { version = "1.17", features = ["const-generics"] } diff --git a/src/iter.rs b/src/iter.rs index 3ba5f03..281bab1 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -18,8 +18,7 @@ impl fmt::Display for TryFromIteratorError { } } -#[cfg(feature = "std")] -impl std::error::Error for TryFromIteratorError {} +impl core::error::Error for TryFromIteratorError {} impl Array where From 37458c0c1ef111b76b19845c285dd21cdbfbfb9b Mon Sep 17 00:00:00 2001 From: Christiaan676 <31404228+Christiaan676@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:30:24 +0200 Subject: [PATCH 2/3] Remove std feature --- Cargo.toml | 1 - src/lib.rs | 3 --- 2 files changed, 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f010dab..4c8c312 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,6 @@ typenum = { version = "1.17", features = ["const-generics"] } zeroize = { version = "1.8", optional = true, default-features = false } [features] -std = [] extra-sizes = [] [package.metadata.docs.rs] diff --git a/src/lib.rs b/src/lib.rs index 4c8e037..c60e6b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,9 +84,6 @@ //! If you have any questions, please //! [start a discussion](https://github.com/RustCrypto/hybrid-array/discussions). -#[cfg(feature = "std")] -extern crate std; - pub mod sizes; mod from_fn; From 1cf0279d84bd0f2fa6c16c5ea8824144108c54c2 Mon Sep 17 00:00:00 2001 From: Christiaan676 <31404228+Christiaan676@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:36:57 +0200 Subject: [PATCH 3/3] Fix clippy warnings --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c60e6b3..3488551 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -204,7 +204,7 @@ where U: Add, Sum: ArraySize, { - self.into_iter().chain(other.into_iter()).collect() + self.into_iter().chain(other).collect() } /// Splits `self` at index `N` in two arrays. @@ -763,7 +763,7 @@ where #[inline] fn try_from(slice: &'a [T]) -> Result, TryFromSliceError> { - <&'a Self>::try_from(slice).map(Clone::clone) + <&'a Self>::try_from(slice).cloned() } }