Skip to content

Commit

Permalink
Remove std (#85)
Browse files Browse the repository at this point in the history
Changes to:
- Switch to `core::error::Error`
- Remove std feature
- Fixed two Clippy warnings

As requested in #74 

Changes do bump the MSRV to 1.81 as `core::error` was stabilized in this
release.
  • Loading branch information
Christiaan676 authored Sep 10, 2024
1 parent c8b1a2f commit 49dfead
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/hybrid-array.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
rust:
- 1.65.0 # MSRV
- 1.81.0 # MSRV
- stable
target:
- armv7a-none-eabi
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.65.0 # MSRV
- 1.81.0 # MSRV
- stable
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ 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"] }
zeroize = { version = "1.8", optional = true, default-features = false }

[features]
std = []
extra-sizes = []

[package.metadata.docs.rs]
Expand Down
3 changes: 1 addition & 2 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, U> Array<T, U>
where
Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -207,7 +204,7 @@ where
U: Add<N>,
Sum<U, N>: ArraySize,
{
self.into_iter().chain(other.into_iter()).collect()
self.into_iter().chain(other).collect()
}

/// Splits `self` at index `N` in two arrays.
Expand Down Expand Up @@ -766,7 +763,7 @@ where

#[inline]
fn try_from(slice: &'a [T]) -> Result<Array<T, U>, TryFromSliceError> {
<&'a Self>::try_from(slice).map(Clone::clone)
<&'a Self>::try_from(slice).cloned()
}
}

Expand Down

0 comments on commit 49dfead

Please sign in to comment.