From: Ian Jackson Date: Fri, 26 Feb 2021 12:57:14 +0000 (+0000) Subject: utils: Loop: get rid of unnecessary type parameter X-Git-Tag: otter-0.4.0~350 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a944755c2f774156a2acd22e15fa8e00f53c45b3;p=otter.git utils: Loop: get rid of unnecessary type parameter Signed-off-by: Ian Jackson --- diff --git a/src/utils.rs b/src/utils.rs index e7c8d9c9..66cfcf36 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -303,8 +303,8 @@ impl From for Loop { fn from(e: E) -> Loop { Loop::Error(e) } } -pub trait IteratorExt<'f,U,E,F>: Iterator - where F: 'f + FnMut(Self::Item) -> Result>, +pub trait IteratorExt: Iterator + where F: FnMut(Self::Item) -> Result>, { type Return: Iterator; fn map_loop(self, f: F) -> Self::Return where E: EmptyType; @@ -319,11 +319,11 @@ impl EmptyType for Infallible { fn diverge(self) -> T { match self { } } } -impl<'f,T,U,E,F> IteratorExt<'f,U,E,F> for T where - T: 'f + Iterator, - F: 'f + FnMut(Self::Item) -> Result>, +impl IteratorExt for T where + T: Iterator, + F: FnMut(Self::Item) -> Result>, { - type Return = impl Iterator + 'f; + type Return = impl Iterator; fn map_loop(self, f: F) -> Self::Return where E: EmptyType { self .map(f) @@ -332,7 +332,7 @@ impl<'f,T,U,E,F> IteratorExt<'f,U,E,F> for T where .map(|i| i.ok().unwrap()) } - type TryReturn = impl Iterator> + 'f; + type TryReturn = impl Iterator>; fn try_map_loop(self, f: F) -> Self::TryReturn { self .map(f)