diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d60b5a9ad..68adbf998 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,8 @@ on: name: Continuous integration jobs: - compile_and_test_msrv: - name: Compile and test MSRV + compile_and_test_min_msrv: + name: Compile and test min MSRV strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -24,9 +24,26 @@ jobs: - uses: dtolnay/rust-toolchain@1.61.0 with: components: clippy - - uses: taiki-e/install-action@cargo-hack - name: Minimal check - run: cargo clippy -v -p palette --no-default-features --features std + run: cargo clippy -v -p palette --no-default-features --features "std" + - name: Default check + run: cargo clippy -v -p palette + - name: Default tests + run: cargo test -v -p palette + compile_and_test_max_msrv: + name: Compile and test max MSRV + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + env: + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.63.0 + with: + components: clippy + - uses: taiki-e/install-action@cargo-hack - name: find-crate check run: cargo clippy -v -p palette --no-default-features --features "std find-crate" - name: Default check @@ -115,7 +132,8 @@ jobs: name: ci if: success() needs: - - compile_and_test_msrv + - compile_and_test_min_msrv + - compile_and_test_max_msrv - integration_tests - check_stable_beta_nightly - no_std diff --git a/README.md b/README.md index 0258d1f9b..fae4c5d40 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ A color management and conversion library that focuses on maintaining correctnes ## Minimum Supported Rust Version (MSRV) -This version of Palette has been automatically tested with Rust version `1.61.0` and the `stable`, `beta`, and `nightly` channels. Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes. +This version of Palette has been automatically tested with Rust version `1.61.0`, `1.63.0`, and the `stable`, `beta`, and `nightly` channels. The minimum supported version may vary with the set of enabled features. + +Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes. ## Contributing diff --git a/palette/README.md b/palette/README.md index 91822ce07..68633bc37 100644 --- a/palette/README.md +++ b/palette/README.md @@ -15,7 +15,9 @@ A color management and conversion library that focuses on maintaining correctnes ## Minimum Supported Rust Version (MSRV) -This version of Palette has been automatically tested with Rust version `1.61.0` and the `stable`, `beta`, and `nightly` channels. Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes. +This version of Palette has been automatically tested with Rust version `1.61.0`, `1.63.0`, and the `stable`, `beta`, and `nightly` channels. The minimum supported version may vary with the set of enabled features. + +Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes. ## Getting Started diff --git a/palette/src/cast/as_arrays_traits.rs b/palette/src/cast/as_arrays_traits.rs index 6f02cd855..2f7044d20 100644 --- a/palette/src/cast/as_arrays_traits.rs +++ b/palette/src/cast/as_arrays_traits.rs @@ -53,7 +53,7 @@ pub trait AsArraysMut { macro_rules! impl_as_arrays { ($($owning:ty $(where ($($ty_input:tt)+))?),*) => { $( - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> AsArrays<[[T; N]]> for $owning + impl AsArrays<[[T; N]]> for $owning where C: ArrayCast, { @@ -63,7 +63,7 @@ macro_rules! impl_as_arrays { } } - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> AsArraysMut<[[T; N]]> for $owning + impl AsArraysMut<[[T; N]]> for $owning where C: ArrayCast, { @@ -142,7 +142,7 @@ pub trait ArraysAsMut { macro_rules! impl_arrays_as { ($($owning:ty $(where ($($ty_input:tt)+))?),*) => { $( - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> ArraysAs<[C]> for $owning + impl ArraysAs<[C]> for $owning where C: ArrayCast, { @@ -152,7 +152,7 @@ macro_rules! impl_arrays_as { } } - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> ArraysAsMut<[C]> for $owning + impl ArraysAsMut<[C]> for $owning where C: ArrayCast, { diff --git a/palette/src/cast/as_components_traits.rs b/palette/src/cast/as_components_traits.rs index 8165d1835..93c898e1e 100644 --- a/palette/src/cast/as_components_traits.rs +++ b/palette/src/cast/as_components_traits.rs @@ -57,7 +57,7 @@ pub trait AsComponentsMut { macro_rules! impl_as_components { ($($owning:ty $(where ($($ty_input:tt)+))?),*) => { $( - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> AsComponents<[T]> for $owning + impl AsComponents<[T]> for $owning where C: ArrayCast, { @@ -67,7 +67,7 @@ macro_rules! impl_as_components { } } - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> AsComponentsMut<[T]> for $owning + impl AsComponentsMut<[T]> for $owning where C: ArrayCast, { @@ -192,7 +192,7 @@ pub trait TryComponentsAsMut { macro_rules! impl_try_components_as { ($($owning:ty $(where ($($ty_input:tt)+))?),*) => { $( - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> TryComponentsAs<[C]> for $owning + impl TryComponentsAs<[C]> for $owning where C: ArrayCast, { @@ -204,7 +204,7 @@ macro_rules! impl_try_components_as { } } - impl<'a, T, C, const N: usize $(, $($ty_input)+)?> TryComponentsAsMut<[C]> for $owning + impl TryComponentsAsMut<[C]> for $owning where C: ArrayCast, { diff --git a/palette/src/cast/as_uints_traits.rs b/palette/src/cast/as_uints_traits.rs index 3471cab4b..4af79ddce 100644 --- a/palette/src/cast/as_uints_traits.rs +++ b/palette/src/cast/as_uints_traits.rs @@ -69,7 +69,7 @@ pub trait AsUintsMut { macro_rules! impl_as_uints { ($($owning:ty $(where ($($ty_input:tt)+))?),*) => { $( - impl<'a, C $(, $($ty_input)+)?> AsUints<[C::Uint]> for $owning + impl AsUints<[C::Uint]> for $owning where C: UintCast, { @@ -79,7 +79,7 @@ macro_rules! impl_as_uints { } } - impl<'a, C $(, $($ty_input)+)?> AsUintsMut<[C::Uint]> for $owning + impl AsUintsMut<[C::Uint]> for $owning where C: UintCast, { @@ -194,7 +194,7 @@ pub trait UintsAsMut { macro_rules! impl_uints_as { ($($owning:ty $(where ($($ty_input:tt)+))?),*) => { $( - impl<'a, C $(, $($ty_input)+)?> UintsAs<[C]> for $owning + impl UintsAs<[C]> for $owning where C: UintCast, { @@ -204,7 +204,7 @@ macro_rules! impl_uints_as { } } - impl<'a, C $(, $($ty_input)+)?> UintsAsMut<[C]> for $owning + impl UintsAsMut<[C]> for $owning where C: UintCast, { diff --git a/palette/src/macros/struct_of_arrays.rs b/palette/src/macros/struct_of_arrays.rs index 923e5b52e..214859029 100644 --- a/palette/src/macros/struct_of_arrays.rs +++ b/palette/src/macros/struct_of_arrays.rs @@ -150,7 +150,7 @@ macro_rules! impl_struct_of_array_traits { } #[cfg(feature = "alloc")] - impl<'a, $($phantom_ty,)? T> IntoIterator for crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> + impl<$($phantom_ty,)? T> IntoIterator for crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? T>, T>; @@ -268,7 +268,7 @@ macro_rules! impl_struct_of_array_traits { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a T>, &'a T>; @@ -299,7 +299,7 @@ macro_rules! impl_struct_of_array_traits { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a T>, &'a T>; @@ -388,7 +388,7 @@ macro_rules! impl_struct_of_array_traits { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a mut T>, &'a mut T>; @@ -421,7 +421,7 @@ macro_rules! impl_struct_of_array_traits { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a mut T>, &'a mut T>; @@ -658,7 +658,7 @@ macro_rules! impl_struct_of_array_traits_hue { } #[cfg(feature = "alloc")] - impl<'a, $($phantom_ty,)? T> IntoIterator for crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> + impl<$($phantom_ty,)? T> IntoIterator for crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? T>, T>; @@ -780,7 +780,7 @@ macro_rules! impl_struct_of_array_traits_hue { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a T>, &'a T>; @@ -812,7 +812,7 @@ macro_rules! impl_struct_of_array_traits_hue { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a T>, &'a T>; @@ -904,7 +904,7 @@ macro_rules! impl_struct_of_array_traits_hue { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::vec::Vec>, alloc::vec::Vec> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a mut T>, &'a mut T>; @@ -936,7 +936,7 @@ macro_rules! impl_struct_of_array_traits_hue { } #[cfg(feature = "alloc")] - impl<'a, 'b, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> + impl<'a, $($phantom_ty,)? T> IntoIterator for &'a mut crate::alpha::Alpha<$self_ty<$($phantom_ty,)? alloc::boxed::Box<[T]>>, alloc::boxed::Box<[T]>> { type Item = crate::alpha::Alpha<$self_ty<$($phantom_ty,)? &'a mut T>, &'a mut T>; diff --git a/palette_derive/README.md b/palette_derive/README.md index e73f575f9..b42ac6620 100644 --- a/palette_derive/README.md +++ b/palette_derive/README.md @@ -4,7 +4,9 @@ Contains derive macros for the [`palette`](https://crates.io/crates/palette/) cr ## Minimum Supported Rust Version (MSRV) -This version of Palette has been automatically tested with Rust version `1.61.0` and the `stable`, `beta`, and `nightly` channels. Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes. +This version of Palette has been automatically tested with Rust version `1.61.0`, `1.63.0`, and the `stable`, `beta`, and `nightly` channels. The minimum supported version may vary with the set of enabled features. + +Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes. ## License diff --git a/palette_derive/src/meta/mod.rs b/palette_derive/src/meta/mod.rs index 2b0ce1257..4204edcdf 100644 --- a/palette_derive/src/meta/mod.rs +++ b/palette_derive/src/meta/mod.rs @@ -140,7 +140,7 @@ pub fn assert_path_meta(meta: &Meta) -> Result<()> { Ok(()) } -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub struct KeyValuePair { pub key: Ident, pub value: Ident,