From cea364094f1c0a0678e038715117fdc406a80fa4 Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Sat, 3 Dec 2022 15:40:12 +0100 Subject: [PATCH] Remove some Serialize trait bounds Containers for the most part do not have any trait requirements for iterating over them. So these bounds are unnecessary when Serializing only. --- serde/src/ser/impls.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index c254ac6545..e9082f4392 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -184,11 +184,10 @@ where #[cfg(any(feature = "std", feature = "alloc"))] macro_rules! seq_impl { - ($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => { + ($ty:ident < T $(, $typaram:ident)* >) => { impl Serialize for $ty where - T: Serialize $(+ $tbound1 $(+ $tbound2)*)*, - $($typaram: $bound,)* + T: Serialize, { #[inline] fn serialize(&self, serializer: S) -> Result @@ -202,13 +201,13 @@ macro_rules! seq_impl { } #[cfg(any(feature = "std", feature = "alloc"))] -seq_impl!(BinaryHeap); +seq_impl!(BinaryHeap); #[cfg(any(feature = "std", feature = "alloc"))] -seq_impl!(BTreeSet); +seq_impl!(BTreeSet); #[cfg(feature = "std")] -seq_impl!(HashSet); +seq_impl!(HashSet); #[cfg(any(feature = "std", feature = "alloc"))] seq_impl!(LinkedList);