Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os: [ubuntu-latest]
rust:
- 1.47.0 # approximate MSRV is Stable -30
- 1.55.0 # approximate MSRV is Stable -30
- stable
- beta
- nightly
Expand All @@ -28,11 +28,11 @@ jobs:
toolchain: ${{ matrix.rust }}
# On MSRV some dev-dependencies don't build so we can't run tests.
- name: Check MSRV
if: matrix.rust == '1.47.0'
if: matrix.rust == '1.55.0'
run: |
cargo check --features=alloc,std,grab_spare_slice
- name: Test non nightly
if: matrix.rust != '1.47.0' && matrix.rust != 'nightly'
if: matrix.rust != '1.55.0' && matrix.rust != 'nightly'
run: |
cargo test --features=alloc,std,grab_spare_slice,latest_stable_rust
- name: Test on Nightly with All Features
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ grab_spare_slice = []
# obsolete feature that has to stay for semver reasons
rustc_1_40 = []

# features that require rustc 1.55
# use const generics to implement Array for all array lengths
rustc_1_55 = ["rustc_1_40"]
# obsolete feature that has to stay for semver reasons
rustc_1_55 = []

# features that require rustc 1.57
# add try_reserve functions to types that heap allocate.
rustc_1_57 = ["rustc_1_55"]
rustc_1_57 = []

# features that require rustc 1.61
# add retain_mut function to TinyVec
Expand Down
53 changes: 0 additions & 53 deletions gen-array-impls.sh

This file was deleted.

10 changes: 1 addition & 9 deletions src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
/// * You can get a shared or mutable slice to the elements.
///
/// You are generally **not** expected to need to implement this yourself. It is
/// already implemented for all the major array lengths (`0..=32` and the powers
/// of 2 up to 4,096), or for all array lengths with the feature `rustc_1_55`.
/// already implemented for all array lengths.
///
/// **Additional lengths can easily be added upon request.**
///
Expand Down Expand Up @@ -41,14 +40,7 @@ pub trait Array {
fn default() -> Self;
}

#[cfg(all(feature = "generic-array", not(feature = "rustc_1_55")))]
core::compile_error!("generic-array requires `rustc_1_55` feature");

#[cfg(feature = "rustc_1_55")]
mod const_generic_impl;

#[cfg(not(feature = "rustc_1_55"))]
mod generated_impl;

#[cfg(feature = "generic-array")]
mod generic_array_impl;
2 changes: 0 additions & 2 deletions src/array/const_generic_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ impl<T: Default, const N: usize> Array for [T; N] {
const CAPACITY: usize = N;

#[inline(always)]
#[must_use]
fn as_slice(&self) -> &[T] {
&*self
}

#[inline(always)]
#[must_use]
fn as_slice_mut(&mut self) -> &mut [T] {
&mut *self
}
Expand Down
Loading
Loading