pub trait IterExt: Iterator { fn just_one(&mut self) -> Option { let one = self.next()?; match self.next() { Some(_) => None, None => Some(one), } } } impl IterExt for T {}