]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/booleans.rs
Auto merge of #7256 - xFrednet:7172-trick-cargos-caching-for-collection, r=flip1995
[rust.git] / clippy_lints / src / booleans.rs
index 58d9aa9c005c2226966d0f148413a83f9b5ade15..e72399af232b5f399cfe283126ac528383626fc2 100644 (file)
@@ -66,7 +66,7 @@ fn check_fn(
         _: Span,
         _: HirId,
     ) {
-        NonminimalBoolVisitor { cx }.visit_body(body)
+        NonminimalBoolVisitor { cx }.visit_body(body);
     }
 }
 
@@ -184,7 +184,7 @@ fn recurse(&mut self, suggestion: &Bool) -> Option<()> {
                 Term(n) => {
                     let terminal = self.terminals[n as usize];
                     if let Some(str) = simplify_not(self.cx, terminal) {
-                        self.output.push_str(&str)
+                        self.output.push_str(&str);
                     } else {
                         self.output.push('!');
                         let snip = snippet_opt(self.cx, terminal.span)?;
@@ -261,7 +261,7 @@ fn simplify_not(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<String> {
             }
             METHODS_WITH_NEGATION
                 .iter()
-                .cloned()
+                .copied()
                 .flat_map(|(a, b)| vec![(a, b), (b, a)])
                 .find(|&(a, _)| {
                     let path: &str = &path.ident.name.as_str();
@@ -452,7 +452,7 @@ fn visit_expr(&mut self, e: &'tcx Expr<'_>) {
         }
         match &e.kind {
             ExprKind::Binary(binop, _, _) if binop.node == BinOpKind::Or || binop.node == BinOpKind::And => {
-                self.bool_expr(e)
+                self.bool_expr(e);
             },
             ExprKind::Unary(UnOp::Not, inner) => {
                 if self.cx.typeck_results().node_types()[inner.hir_id].is_bool() {