We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
clippy_lints::methods::derefs_to_slice()
2 parents 1a1ad5e + f5122ae commit 97bb063Copy full SHA for 97bb063
clippy_lints/src/methods/utils.rs
@@ -8,6 +8,9 @@ use rustc_middle::ty::{self, Ty};
8
use rustc_span::Span;
9
use rustc_span::symbol::sym;
10
11
+/// Checks if `expr`, of type `ty`, corresponds to a slice or can be dereferenced to a slice, or if
12
+/// `expr` is a method call to `.iter()` on such a type. In these cases, return the slice-like
13
+/// expression.
14
pub(super) fn derefs_to_slice<'tcx>(
15
cx: &LateContext<'tcx>,
16
expr: &'tcx Expr<'tcx>,
0 commit comments