11use clippy_config:: Conf ;
22use clippy_utils:: diagnostics:: { span_lint_and_sugg, span_lint_hir_and_then} ;
3- use clippy_utils:: eq_expr_value;
43use clippy_utils:: msrvs:: { self , Msrv } ;
54use clippy_utils:: source:: SpanRangeExt ;
65use clippy_utils:: sugg:: Sugg ;
76use clippy_utils:: ty:: { implements_trait, is_type_diagnostic_item} ;
7+ use clippy_utils:: { eq_expr_value, sym} ;
88use rustc_ast:: ast:: LitKind ;
99use rustc_attr_data_structures:: RustcVersion ;
1010use rustc_errors:: Applicability ;
@@ -13,7 +13,7 @@ use rustc_hir::{BinOpKind, Body, Expr, ExprKind, FnDecl, UnOp};
1313use rustc_lint:: { LateContext , LateLintPass , Level } ;
1414use rustc_session:: impl_lint_pass;
1515use rustc_span:: def_id:: LocalDefId ;
16- use rustc_span:: { Span , SyntaxContext , sym } ;
16+ use rustc_span:: { Span , Symbol , SyntaxContext } ;
1717
1818declare_clippy_lint ! {
1919 /// ### What it does
@@ -73,10 +73,10 @@ declare_clippy_lint! {
7373}
7474
7575// For each pairs, both orders are considered.
76- const METHODS_WITH_NEGATION : [ ( Option < RustcVersion > , & str , & str ) ; 3 ] = [
77- ( None , " is_some" , " is_none" ) ,
78- ( None , " is_err" , " is_ok" ) ,
79- ( Some ( msrvs:: IS_NONE_OR ) , " is_some_and" , " is_none_or" ) ,
76+ const METHODS_WITH_NEGATION : [ ( Option < RustcVersion > , Symbol , Symbol ) ; 3 ] = [
77+ ( None , sym :: is_some, sym :: is_none) ,
78+ ( None , sym :: is_err, sym :: is_ok) ,
79+ ( Some ( msrvs:: IS_NONE_OR ) , sym :: is_some_and, sym :: is_none_or) ,
8080] ;
8181
8282pub struct NonminimalBool {
@@ -440,9 +440,7 @@ fn simplify_not(cx: &LateContext<'_>, curr_msrv: Msrv, expr: &Expr<'_>) -> Optio
440440 . iter ( )
441441 . copied ( )
442442 . flat_map ( |( msrv, a, b) | vec ! [ ( msrv, a, b) , ( msrv, b, a) ] )
443- . find ( |& ( msrv, a, _) | {
444- a == path. ident . name . as_str ( ) && msrv. is_none_or ( |msrv| curr_msrv. meets ( cx, msrv) )
445- } )
443+ . find ( |& ( msrv, a, _) | a == path. ident . name && msrv. is_none_or ( |msrv| curr_msrv. meets ( cx, msrv) ) )
446444 . and_then ( |( _, _, neg_method) | {
447445 let negated_args = args
448446 . iter ( )
0 commit comments