File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,16 @@ impl EarlyLintPass for Precedence {
104104
105105 if let ExprKind :: Unary ( UnOp :: Neg , ref rhs) = expr. kind {
106106 if let ExprKind :: MethodCall ( ref path_segment, ref args) = rhs. kind {
107+ let path_segment_str = path_segment. ident . name . as_str ( ) ;
107108 if let Some ( slf) = args. first ( ) {
108109 if let ExprKind :: Lit ( ref lit) = slf. kind {
109110 match lit. kind {
110111 LitKind :: Int ( ..) | LitKind :: Float ( ..) => {
111- for & odd_function in & ODD_FUNCTIONS_WHITELIST {
112- if odd_function == & * path_segment. ident . name . as_str ( ) {
113- return ;
114- }
112+ if ODD_FUNCTIONS_WHITELIST
113+ . iter ( )
114+ . any ( |odd_function| * * odd_function == * path_segment_str)
115+ {
116+ return ;
115117 }
116118 let mut applicability = Applicability :: MachineApplicable ;
117119 span_lint_and_sugg (
You can’t perform that action at this time.
0 commit comments