@@ -156,7 +156,6 @@ struct SuggestContext<'a, 'tcx, 'v> {
156
156
terminals : & ' v [ & ' v Expr ] ,
157
157
cx : & ' a LateContext < ' a , ' tcx > ,
158
158
output : String ,
159
- simplified : bool ,
160
159
}
161
160
162
161
impl < ' a , ' tcx , ' v > SuggestContext < ' a , ' tcx , ' v > {
@@ -179,7 +178,6 @@ impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
179
178
Term ( n) => {
180
179
let terminal = self . terminals [ n as usize ] ;
181
180
if let Some ( str) = simplify_not ( self . cx , terminal) {
182
- self . simplified = true ;
183
181
self . output . push_str ( & str)
184
182
} else {
185
183
self . output . push ( '!' ) ;
@@ -264,16 +262,14 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
264
262
}
265
263
}
266
264
267
- // The boolean part of the return indicates whether some simplifications have been applied.
268
- fn suggest ( cx : & LateContext < ' _ , ' _ > , suggestion : & Bool , terminals : & [ & Expr ] ) -> ( String , bool ) {
265
+ fn suggest ( cx : & LateContext < ' _ , ' _ > , suggestion : & Bool , terminals : & [ & Expr ] ) -> String {
269
266
let mut suggest_context = SuggestContext {
270
267
terminals,
271
268
cx,
272
269
output : String :: new ( ) ,
273
- simplified : false ,
274
270
} ;
275
271
suggest_context. recurse ( suggestion) ;
276
- ( suggest_context. output , suggest_context . simplified )
272
+ suggest_context. output
277
273
}
278
274
279
275
fn simple_negate ( b : Bool ) -> Bool {
@@ -383,7 +379,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
383
379
db. span_suggestion (
384
380
e. span ,
385
381
"it would look like the following" ,
386
- suggest ( self . cx , suggestion, & h2q. terminals ) . 0 ,
382
+ suggest ( self . cx , suggestion, & h2q. terminals ) ,
387
383
// nonminimal_bool can produce minimal but
388
384
// not human readable expressions (#3141)
389
385
Applicability :: Unspecified ,
@@ -428,7 +424,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
428
424
nonminimal_bool_lint (
429
425
improvements
430
426
. into_iter ( )
431
- . map ( |suggestion| suggest ( self . cx , suggestion, & h2q. terminals ) . 0 )
427
+ . map ( |suggestion| suggest ( self . cx , suggestion, & h2q. terminals ) )
432
428
. collect ( ) ,
433
429
) ;
434
430
}
0 commit comments