forked from taiki-e/auto_enums
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-1.expanded.rs
88 lines (88 loc) · 3.18 KB
/
example-1.expanded.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
fn foo(x: i32) -> impl Iterator<Item = i32> {
enum __Enum1<__T1, __T2> {
__T1(__T1),
__T2(__T2),
}
impl<__T1, __T2> ::core::iter::Iterator for __Enum1<__T1, __T2>
where
__T1: ::core::iter::Iterator,
__T2: ::core::iter::Iterator<Item = <__T1 as ::core::iter::Iterator>::Item>,
{
type Item = <__T1 as ::core::iter::Iterator>::Item;
#[inline]
fn next(&mut self) -> ::core::option::Option<Self::Item> {
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::next(x),
__Enum1::__T2(x) => ::core::iter::Iterator::next(x),
}
}
#[inline]
fn size_hint(&self) -> (usize, ::core::option::Option<usize>) {
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::size_hint(x),
__Enum1::__T2(x) => ::core::iter::Iterator::size_hint(x),
}
}
#[inline]
fn count(self) -> usize {
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::count(x),
__Enum1::__T2(x) => ::core::iter::Iterator::count(x),
}
}
#[inline]
fn last(self) -> ::core::option::Option<Self::Item> {
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::last(x),
__Enum1::__T2(x) => ::core::iter::Iterator::last(x),
}
}
#[inline]
#[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"]
fn collect<__U: ::core::iter::FromIterator<Self::Item>>(self) -> __U {
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::collect(x),
__Enum1::__T2(x) => ::core::iter::Iterator::collect(x),
}
}
#[inline]
fn fold<__U, __F>(self, init: __U, f: __F) -> __U
where
__F: ::core::ops::FnMut(__U, Self::Item) -> __U,
{
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::fold(x, init, f),
__Enum1::__T2(x) => ::core::iter::Iterator::fold(x, init, f),
}
}
#[inline]
fn find<__P>(&mut self, predicate: __P) -> ::core::option::Option<Self::Item>
where
__P: ::core::ops::FnMut(&Self::Item) -> bool,
{
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::find(x, predicate),
__Enum1::__T2(x) => ::core::iter::Iterator::find(x, predicate),
}
}
#[inline]
fn find_map<__U, __F>(&mut self, f: __F) -> ::core::option::Option<__U>
where
__F: ::core::ops::FnMut(Self::Item) -> ::core::option::Option<__U>,
{
match self {
__Enum1::__T1(x) => ::core::iter::Iterator::find_map(x, f),
__Enum1::__T2(x) => ::core::iter::Iterator::find_map(x, f),
}
}
}
match x {
0 => __Enum1::__T1(1..10),
_ => {
__Enum1::__T2(
<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([5, 10]))
.into_iter(),
)
}
}
}