From 6b931e557b3eede35c635f9b03141004e523e20c Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:09:15 +0100 Subject: [PATCH] `MapInto`: relax `Debug/Clone` bounds Derive those adds a bound on `U` which is not needed since it's only `PhantomData`. Note that `PhantomData` is `Debug` for any `T`. --- src/adaptors/map.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/adaptors/map.rs b/src/adaptors/map.rs index d57b11dc7..c78b9be69 100644 --- a/src/adaptors/map.rs +++ b/src/adaptors/map.rs @@ -108,9 +108,19 @@ impl, U> MapSpecialCaseFn for MapSpecialCaseFnInto { } } -#[derive(Clone, Debug)] pub struct MapSpecialCaseFnInto(PhantomData); +impl std::fmt::Debug for MapSpecialCaseFnInto { + debug_fmt_fields!(MapSpecialCaseFnInto, 0); +} + +impl Clone for MapSpecialCaseFnInto { + #[inline] + fn clone(&self) -> Self { + Self(PhantomData) + } +} + /// Create a new [`MapInto`] iterator. pub fn map_into(iter: I) -> MapInto { MapSpecialCase {