From ce86a2740e41d8b8116bd884c6dff4c60425bd9a Mon Sep 17 00:00:00 2001 From: Erik Hedvall Date: Sat, 24 Feb 2024 16:04:34 +0100 Subject: [PATCH] Remove unused traits and unnecessary import --- palette/src/cast/array.rs | 2 +- palette/src/hsl.rs | 3 --- palette/src/hsv.rs | 3 --- palette/src/hues.rs | 5 +---- palette/src/hwb.rs | 3 --- palette_derive/src/meta/mod.rs | 15 --------------- 6 files changed, 2 insertions(+), 29 deletions(-) diff --git a/palette/src/cast/array.rs b/palette/src/cast/array.rs index e55b6ac20..25c9e9f2d 100644 --- a/palette/src/cast/array.rs +++ b/palette/src/cast/array.rs @@ -1,6 +1,6 @@ use core::mem::{transmute_copy, ManuallyDrop}; -#[cfg(feature = "alloc")] +#[cfg(all(feature = "alloc", not(feature = "std")))] use alloc::{boxed::Box, vec::Vec}; pub use palette_derive::ArrayCast; diff --git a/palette/src/hsl.rs b/palette/src/hsl.rs index 50c0e0bc5..7bc4591fa 100644 --- a/palette/src/hsl.rs +++ b/palette/src/hsl.rs @@ -533,9 +533,6 @@ unsafe impl bytemuck::Pod for Hsl where T: bytemuck::Pod {} mod test { use super::Hsl; - #[cfg(feature = "alloc")] - use crate::Srgb; - test_convert_into_from_xyz!(Hsl); #[cfg(feature = "approx")] diff --git a/palette/src/hsv.rs b/palette/src/hsv.rs index 559676df7..6188bd7ff 100644 --- a/palette/src/hsv.rs +++ b/palette/src/hsv.rs @@ -540,9 +540,6 @@ unsafe impl bytemuck::Pod for Hsv where T: bytemuck::Pod {} mod test { use super::Hsv; - #[cfg(feature = "alloc")] - use crate::Srgb; - test_convert_into_from_xyz!(Hsv); #[cfg(feature = "approx")] diff --git a/palette/src/hues.rs b/palette/src/hues.rs index 371bf9a8f..6505574b6 100644 --- a/palette/src/hues.rs +++ b/palette/src/hues.rs @@ -3,10 +3,7 @@ #[cfg(any(feature = "approx", feature = "random"))] use core::ops::Mul; -use core::{ - cmp::PartialEq, - ops::{Add, AddAssign, Neg, Sub, SubAssign}, -}; +use core::ops::{Add, AddAssign, Neg, Sub, SubAssign}; #[cfg(feature = "approx")] use approx::{AbsDiffEq, RelativeEq, UlpsEq}; diff --git a/palette/src/hwb.rs b/palette/src/hwb.rs index cb815e8cc..7b84540be 100644 --- a/palette/src/hwb.rs +++ b/palette/src/hwb.rs @@ -366,9 +366,6 @@ unsafe impl bytemuck::Pod for Hwb where T: bytemuck::Pod {} mod test { use super::Hwb; - #[cfg(feature = "alloc")] - use crate::Srgb; - test_convert_into_from_xyz!(Hwb); #[cfg(feature = "approx")] diff --git a/palette_derive/src/meta/mod.rs b/palette_derive/src/meta/mod.rs index ab01c9b00..9f0fcc11c 100644 --- a/palette_derive/src/meta/mod.rs +++ b/palette_derive/src/meta/mod.rs @@ -207,21 +207,6 @@ impl ::quote::ToTokens for IdentOrIndex { } } -pub trait MetaParser: Default { - fn internal(&mut self); - fn parse_attribute(&mut self, attribute_name: Ident, attribute_tts: TokenStream) -> Result<()>; -} - -pub trait DataMetaParser: Default { - fn parse_struct_field_attribute( - &mut self, - field_name: IdentOrIndex, - ty: Type, - attribute_name: Ident, - attribute_tts: TokenStream, - ) -> Result<()>; -} - pub trait AttributeArgumentParser: Default { fn argument(&mut self, argument: Meta) -> Result<()>; }