Skip to content

Commit 49dfead

Browse files
Remove std (#85)
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.
1 parent c8b1a2f commit 49dfead

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

.github/workflows/hybrid-array.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
rust:
26-
- 1.65.0 # MSRV
26+
- 1.81.0 # MSRV
2727
- stable
2828
target:
2929
- armv7a-none-eabi
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- uses: dtolnay/rust-toolchain@master
5555
with:
56-
toolchain: 1.75.0
56+
toolchain: 1.81.0
5757
components: clippy
5858
- run: cargo clippy --all --all-features -- -D warnings
5959

@@ -95,7 +95,7 @@ jobs:
9595
strategy:
9696
matrix:
9797
toolchain:
98-
- 1.65.0 # MSRV
98+
- 1.81.0 # MSRV
9999
- stable
100100
runs-on: ubuntu-latest
101101
steps:

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ categories = ["no-std", "data-structures"]
1414
keywords = ["generic-array"]
1515
readme = "README.md"
1616
edition = "2021"
17-
rust-version = "1.65"
17+
rust-version = "1.81.0"
1818

1919
[dependencies]
2020
typenum = { version = "1.17", features = ["const-generics"] }
2121
zeroize = { version = "1.8", optional = true, default-features = false }
2222

2323
[features]
24-
std = []
2524
extra-sizes = []
2625

2726
[package.metadata.docs.rs]

src/iter.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ impl fmt::Display for TryFromIteratorError {
1818
}
1919
}
2020

21-
#[cfg(feature = "std")]
22-
impl std::error::Error for TryFromIteratorError {}
21+
impl core::error::Error for TryFromIteratorError {}
2322

2423
impl<T, U> Array<T, U>
2524
where

src/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@
8484
//! If you have any questions, please
8585
//! [start a discussion](https://github.com/RustCrypto/hybrid-array/discussions).
8686
87-
#[cfg(feature = "std")]
88-
extern crate std;
89-
9087
pub mod sizes;
9188

9289
mod from_fn;
@@ -207,7 +204,7 @@ where
207204
U: Add<N>,
208205
Sum<U, N>: ArraySize,
209206
{
210-
self.into_iter().chain(other.into_iter()).collect()
207+
self.into_iter().chain(other).collect()
211208
}
212209

213210
/// Splits `self` at index `N` in two arrays.
@@ -766,7 +763,7 @@ where
766763

767764
#[inline]
768765
fn try_from(slice: &'a [T]) -> Result<Array<T, U>, TryFromSliceError> {
769-
<&'a Self>::try_from(slice).map(Clone::clone)
766+
<&'a Self>::try_from(slice).cloned()
770767
}
771768
}
772769

0 commit comments

Comments
 (0)