]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/regex.rs
Improve `implicit_return`
[rust.git] / clippy_lints / src / regex.rs
index bfa21ba9c97009ea3032dff8a09f8154a169b933..4b5306de58ecdc4e911a4f3c7a9b78929e730d15 100644 (file)
@@ -1,6 +1,6 @@
 use crate::consts::{constant, Constant};
-use crate::utils::{match_def_path, paths};
 use clippy_utils::diagnostics::{span_lint, span_lint_and_help};
+use clippy_utils::{match_def_path, paths};
 use if_chain::if_chain;
 use rustc_ast::ast::{LitKind, StrStyle};
 use rustc_data_structures::fx::FxHashSet;
@@ -60,7 +60,7 @@ pub struct Regex {
 impl<'tcx> LateLintPass<'tcx> for Regex {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
         if_chain! {
-            if let ExprKind::Call(ref fun, ref args) = expr.kind;
+            if let ExprKind::Call(fun, args) = expr.kind;
             if let ExprKind::Path(ref qpath) = fun.kind;
             if args.len() == 1;
             if let Some(def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id();
@@ -134,7 +134,7 @@ fn is_trivial_regex(s: &regex_syntax::hir::Hir) -> Option<&'static str> {
 
 fn check_set<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, utf8: bool) {
     if_chain! {
-        if let ExprKind::AddrOf(BorrowKind::Ref, _, ref expr) = expr.kind;
+        if let ExprKind::AddrOf(BorrowKind::Ref, _, expr) = expr.kind;
         if let ExprKind::Array(exprs) = expr.kind;
         then {
             for expr in exprs {