Skip to content

Commit 6b931e5

Browse files
Philippe-Choletjswrenn
authored andcommitted
MapInto: relax Debug/Clone bounds
Derive those adds a bound on `U` which is not needed since it's only `PhantomData`. Note that `PhantomData<T>` is `Debug` for any `T`.
1 parent 3918da2 commit 6b931e5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/adaptors/map.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,19 @@ impl<T: Into<U>, U> MapSpecialCaseFn<T> for MapSpecialCaseFnInto<U> {
108108
}
109109
}
110110

111-
#[derive(Clone, Debug)]
112111
pub struct MapSpecialCaseFnInto<U>(PhantomData<U>);
113112

113+
impl<U> std::fmt::Debug for MapSpecialCaseFnInto<U> {
114+
debug_fmt_fields!(MapSpecialCaseFnInto, 0);
115+
}
116+
117+
impl<U> Clone for MapSpecialCaseFnInto<U> {
118+
#[inline]
119+
fn clone(&self) -> Self {
120+
Self(PhantomData)
121+
}
122+
}
123+
114124
/// Create a new [`MapInto`] iterator.
115125
pub fn map_into<I, R>(iter: I) -> MapInto<I, R> {
116126
MapSpecialCase {

0 commit comments

Comments
 (0)