about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/panic_in_result_fn.rs2
-rw-r--r--clippy_lints/src/utils/mod.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/clippy_lints/src/panic_in_result_fn.rs b/clippy_lints/src/panic_in_result_fn.rs
index cdabb0d0dd6..37e2b50def1 100644
--- a/clippy_lints/src/panic_in_result_fn.rs
+++ b/clippy_lints/src/panic_in_result_fn.rs
@@ -53,7 +53,7 @@ impl<'tcx> LateLintPass<'tcx> for PanicInResultFn {
 
 fn lint_impl_body<'tcx>(cx: &LateContext<'tcx>, impl_span: Span, body: &'tcx hir::Body<'tcx>) {
     let panics = find_macro_calls(
-        vec![
+        &[
             "unimplemented",
             "unreachable",
             "panic",
diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs
index e47d71aac99..e83371f8b99 100644
--- a/clippy_lints/src/utils/mod.rs
+++ b/clippy_lints/src/utils/mod.rs
@@ -603,12 +603,12 @@ pub fn contains_return(expr: &hir::Expr<'_>) -> bool {
     visitor.found
 }
 
-struct FindMacroCalls<'a> {
-    names: Vec<&'a str>,
+struct FindMacroCalls<'a, 'b> {
+    names: &'a [&'b str],
     result: Vec<Span>,
 }
 
-impl<'a, 'tcx> Visitor<'tcx> for FindMacroCalls<'a> {
+impl<'a, 'b, 'tcx> Visitor<'tcx> for FindMacroCalls<'a, 'b> {
     type Map = Map<'tcx>;
 
     fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
@@ -625,7 +625,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FindMacroCalls<'a> {
 }
 
 /// Finds calls of the specified macros in a function body.
-pub fn find_macro_calls(names: Vec<&str>, body: &'tcx Body<'tcx>) -> Vec<Span> {
+pub fn find_macro_calls(names: &[&str], body: &Body<'_>) -> Vec<Span> {
     let mut fmc = FindMacroCalls {
         names,
         result: Vec::new(),