@@ -88,7 +88,7 @@ fn double_check<'a>(cx: &LateContext<'_, '_>, left: &'a Expr<'_>, right: &'a Exp
88
88
let upper = check_upper_bound ( l) ;
89
89
let lower = check_lower_bound ( r) ;
90
90
91
- transpose ( upper, lower) . and_then ( |( l, r) | l. combine ( r, cx) )
91
+ upper. zip ( lower) . and_then ( |( l, r) | l. combine ( r, cx) )
92
92
} ;
93
93
94
94
upper_lower ( left, right) . or_else ( || upper_lower ( right, left) )
@@ -131,7 +131,10 @@ impl<'a> Conversion<'a> {
131
131
132
132
/// Checks if the to-type is the same (if there is a type constraint)
133
133
fn has_compatible_to_type ( & self , other : & Self ) -> bool {
134
- transpose ( self . to_type . as_ref ( ) , other. to_type . as_ref ( ) ) . map_or ( true , |( l, r) | l == r)
134
+ match ( self . to_type , other. to_type ) {
135
+ ( Some ( l) , Some ( r) ) => l == r,
136
+ _ => true ,
137
+ }
135
138
}
136
139
137
140
/// Try to construct a new conversion if the conversion type is valid
@@ -322,14 +325,6 @@ fn int_ty_to_sym<'tcx>(path: &QPath<'_>) -> Option<&'tcx str> {
322
325
}
323
326
}
324
327
325
- /// (Option<T>, Option<U>) -> Option<(T, U)>
326
- fn transpose < T , U > ( lhs : Option < T > , rhs : Option < U > ) -> Option < ( T , U ) > {
327
- match ( lhs, rhs) {
328
- ( Some ( l) , Some ( r) ) => Some ( ( l, r) ) ,
329
- _ => None ,
330
- }
331
- }
332
-
333
328
/// Will return the expressions as if they were expr1 <= expr2
334
329
fn normalize_le_ge < ' a > ( op : & BinOp , left : & ' a Expr < ' a > , right : & ' a Expr < ' a > ) -> Option < ( & ' a Expr < ' a > , & ' a Expr < ' a > ) > {
335
330
match op. node {
0 commit comments