Skip to content

Commit

Permalink
Document MSRV as 1.70
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Feb 13, 2024
1 parent f4c8df1 commit 2904195
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ jobs:
- name: Run Cargo test
run: cargo +nightly test --all-features

test-msrv:
runs-on: ubuntu-latest
steps:
- name: Install stable 1.70 toolchain
uses: dtolnay/[email protected]

- name: Checkout repository
uses: actions/checkout@v4

- name: Run Cargo test
run: cargo test --features serde,typesize

clippy-stable:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "small-fixed-array"
description = "A crate providing fixed length immutable collections with a low memory footprint."
repository = "https://github.com/GnomedDev/small-fixed-array"
rust-version = "1.70"
version = "0.4.0"
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<T, LenT: ValidLength> Default for FixedArray<T, LenT> {

impl<T: Clone, LenT: ValidLength> Clone for FixedArray<T, LenT> {
fn clone(&self) -> Self {
let ptr = Box::<[T]>::from(self.as_slice());
let ptr = self.as_slice().to_vec().into_boxed_slice();

// SAFETY: The Box::from cannot make the length mismatch.
unsafe { Self::from_box_with_nonzero(ptr, self.len) }
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
//! - `nightly`: Speeds up [`FixedString::len`] for small strings, using `portable_simd`.
//! - `serde`: Provides [`serde`] implementations for [`FixedArray`] and [`FixedString`].
//! - `typesize`: Provides [`typesize`] implementations for [`FixedArray`] and [`FixedString`].
//!
//! ## MSRV
//! The minimum supported Rust version for this crate is currently `1.70`, however this may be broken by dependencies,
//! to work around this breakage, use the unstable `minimal-versions` cargo flag if MSRV is important to you.
#![cfg_attr(feature = "nightly", feature(portable_simd))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
Expand Down

0 comments on commit 2904195

Please sign in to comment.