]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | // run-pass |
2 | ||
416331ca XL |
3 | #![feature(type_alias_impl_trait)] |
4 | ||
5 | trait UnwrapItemsExt { | |
6 | type Iter; | |
7 | fn unwrap_items(self) -> Self::Iter; | |
8 | } | |
9 | ||
10 | impl<I, T, E> UnwrapItemsExt for I | |
11 | where | |
12 | I: Iterator<Item = Result<T, E>>, | |
13 | E: std::fmt::Debug, | |
14 | { | |
15 | type Iter = impl Iterator<Item = T>; | |
416331ca XL |
16 | |
17 | fn unwrap_items(self) -> Self::Iter { | |
416331ca XL |
18 | self.map(|x| x.unwrap()) |
19 | } | |
20 | } | |
21 | ||
22 | fn main() {} |