@@ -156,7 +156,6 @@ struct SuggestContext<'a, 'tcx, 'v> {
156156 terminals : & ' v [ & ' v Expr ] ,
157157 cx : & ' a LateContext < ' a , ' tcx > ,
158158 output : String ,
159- simplified : bool ,
160159}
161160
162161impl < ' a , ' tcx , ' v > SuggestContext < ' a , ' tcx , ' v > {
@@ -179,7 +178,6 @@ impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
179178 Term ( n) => {
180179 let terminal = self . terminals [ n as usize ] ;
181180 if let Some ( str) = simplify_not ( self . cx , terminal) {
182- self . simplified = true ;
183181 self . output . push_str ( & str)
184182 } else {
185183 self . output . push ( '!' ) ;
@@ -264,16 +262,14 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
264262 }
265263}
266264
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 {
269266 let mut suggest_context = SuggestContext {
270267 terminals,
271268 cx,
272269 output : String :: new ( ) ,
273- simplified : false ,
274270 } ;
275271 suggest_context. recurse ( suggestion) ;
276- ( suggest_context. output , suggest_context . simplified )
272+ suggest_context. output
277273}
278274
279275fn simple_negate ( b : Bool ) -> Bool {
@@ -383,7 +379,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
383379 db. span_suggestion (
384380 e. span ,
385381 "it would look like the following" ,
386- suggest ( self . cx , suggestion, & h2q. terminals ) . 0 ,
382+ suggest ( self . cx , suggestion, & h2q. terminals ) ,
387383 // nonminimal_bool can produce minimal but
388384 // not human readable expressions (#3141)
389385 Applicability :: Unspecified ,
@@ -428,7 +424,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
428424 nonminimal_bool_lint (
429425 improvements
430426 . into_iter ( )
431- . map ( |suggestion| suggest ( self . cx , suggestion, & h2q. terminals ) . 0 )
427+ . map ( |suggestion| suggest ( self . cx , suggestion, & h2q. terminals ) )
432428 . collect ( ) ,
433429 ) ;
434430 }
0 commit comments