@@ -30,103 +30,23 @@ pub struct Version {
30
30
}
31
31
32
32
// FIXME https://github.com/rust-lang/rust/issues/18738
33
- // derive PartialOrd, Ord
33
+ // derive
34
34
35
35
#[ automatically_derived]
36
36
impl :: std:: cmp:: Ord for Version {
37
37
#[ inline]
38
- fn cmp ( & self , __arg_0 : & Version ) -> :: std:: cmp:: Ordering {
39
- match * __arg_0 {
40
- Version {
41
- major : ref __self_1_0,
42
- minor : ref __self_1_1,
43
- revision : ref __self_1_2,
44
- vendor_info : ref __self_1_3 } =>
45
- match * self {
46
- Version {
47
- major : ref __self_0_0,
48
- minor : ref __self_0_1,
49
- revision : ref __self_0_2,
50
- vendor_info : ref __self_0_3 } => {
51
- let __test = ( * __self_0_0) . cmp ( & ( * __self_1_0) ) ;
52
- if __test == :: std:: cmp:: Equal {
53
- {
54
- let __test =
55
- ( * __self_0_1) . cmp ( & ( * __self_1_1) ) ;
56
- if __test == :: std:: cmp:: Equal {
57
- {
58
- let __test =
59
- ( * __self_0_2) . cmp ( & ( * __self_1_2) ) ;
60
- if __test == :: std:: cmp:: Equal {
61
- {
62
- let __test =
63
- ( * __self_0_3) . cmp ( * __self_1_3) ;
64
- if __test ==
65
- :: std:: cmp:: Equal {
66
- :: std:: cmp:: Equal
67
- } else { __test }
68
- }
69
- } else { __test }
70
- }
71
- } else { __test }
72
- }
73
- } else { __test }
74
- }
75
- } ,
76
- }
38
+ fn cmp ( & self , other : & Version ) -> :: std:: cmp:: Ordering {
39
+ ( & self . major , & self . minor , & self . revision , self . vendor_info )
40
+ . cmp ( & ( & other. major , & other. minor , & other. revision , other. vendor_info ) )
77
41
}
78
42
}
79
43
#[ automatically_derived]
80
44
impl :: std:: cmp:: PartialOrd for Version {
81
45
#[ inline]
82
- fn partial_cmp ( & self , __arg_0 : & Version ) ->
83
- :: std:: option:: Option < :: std:: cmp:: Ordering > {
84
- match * __arg_0 {
85
- Version {
86
- major : ref __self_1_0,
87
- minor : ref __self_1_1,
88
- revision : ref __self_1_2,
89
- vendor_info : ref __self_1_3 } =>
90
- match * self {
91
- Version {
92
- major : ref __self_0_0,
93
- minor : ref __self_0_1,
94
- revision : ref __self_0_2,
95
- vendor_info : ref __self_0_3 } => {
96
- let __test =
97
- ( * __self_0_0) . partial_cmp ( & ( * __self_1_0) ) ;
98
- if __test ==
99
- :: std:: option:: Some ( :: std:: cmp:: Equal ) {
100
- {
101
- let __test =
102
- ( * __self_0_1) . partial_cmp ( & ( * __self_1_1) ) ;
103
- if __test ==
104
- :: std:: option:: Some ( :: std:: cmp:: Equal )
105
- {
106
- {
107
- let __test =
108
- ( * __self_0_2) . partial_cmp ( & ( * __self_1_2) ) ;
109
- if __test ==
110
- :: std:: option:: Some ( :: std:: cmp:: Equal )
111
- {
112
- {
113
- let __test =
114
- ( * __self_0_3) . partial_cmp ( * __self_1_3) ;
115
- if __test ==
116
- :: std:: option:: Some ( :: std:: cmp:: Equal )
117
- {
118
- :: std:: option:: Some ( :: std:: cmp:: Equal )
119
- } else { __test }
120
- }
121
- } else { __test }
122
- }
123
- } else { __test }
124
- }
125
- } else { __test }
126
- }
127
- } ,
128
- }
129
- }
46
+ fn partial_cmp ( & self , other : & Version ) -> :: std:: option:: Option < :: std:: cmp:: Ordering > {
47
+ ( & self . major , & self . minor , & self . revision , self . vendor_info )
48
+ . partial_cmp ( & ( & other. major , & other. minor , & other. revision , other. vendor_info ) )
49
+ }
130
50
}
131
51
132
52
impl Version {
0 commit comments