Debian Codegraph @

third_party/rust/headers/src/util/iter.rs

raw
1 pub trait IterExt: Iterator {
2 fn just_one(&mut self) -> Option<Self::Item> {
3 let one = self.next()?;
4 match self.next() {
5 Some(_) => None,
6 None => Some(one),
7 }
8 }
9 }
10
11 impl<T: Iterator> IterExt for T {}