diff --git a/easytier/src/utils.rs b/easytier/src/utils.rs index bc964cd9..d2933ef2 100644 --- a/easytier/src/utils.rs +++ b/easytier/src/utils.rs @@ -162,15 +162,13 @@ pub trait DeterministicDigest: Serialize { impl DeterministicDigest for S {} -pub trait MapTryInto { - fn map_try_into>(self) -> impl Iterator>; -} - -impl MapTryInto for I -where - I: IntoIterator, -{ - fn map_try_into>(self) -> impl Iterator> { - self.into_iter().map(T::try_from) +pub trait MapTryInto: Iterator + Sized { + fn map_try_into(self) -> impl Iterator>::Error>> + where + Self::Item: TryInto, + { + self.into_iter().map(Self::Item::try_into) } } + +impl MapTryInto for T where T: Iterator + Sized {}