about summary refs log tree commit diff
path: root/clippy_lints/src/string_patterns.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-03 10:45:49 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-17 13:21:02 +1100
commit8cf9eea5b3640fc119db11a70107ef09b44a5082 (patch)
tree91c23c7569d30cf0d2ce067e073b25918f3c1774 /clippy_lints/src/string_patterns.rs
parentfc532c5b322106e8ddc6485451cd5f14c4e995bd (diff)
downloadrust-8cf9eea5b3640fc119db11a70107ef09b44a5082.tar.gz
rust-8cf9eea5b3640fc119db11a70107ef09b44a5082.zip
Move some `Map` methods onto `TyCtxt`.
The end goal is to eliminate `Map` altogether.

I added a `hir_` prefix to all of them, that seemed simplest. The
exceptions are `module_items` which became `hir_module_free_items` because
there was already a `hir_module_items`, and `items` which became
`hir_free_items` for consistency with `hir_module_free_items`.
Diffstat (limited to 'clippy_lints/src/string_patterns.rs')
-rw-r--r--clippy_lints/src/string_patterns.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/string_patterns.rs b/clippy_lints/src/string_patterns.rs
index 3834087f797..694ad4f6347 100644
--- a/clippy_lints/src/string_patterns.rs
+++ b/clippy_lints/src/string_patterns.rs
@@ -138,7 +138,7 @@ fn get_char_span<'tcx>(cx: &'_ LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Optio
 
 fn check_manual_pattern_char_comparison(cx: &LateContext<'_>, method_arg: &Expr<'_>, msrv: &Msrv) {
     if let ExprKind::Closure(closure) = method_arg.kind
-        && let body = cx.tcx.hir().body(closure.body)
+        && let body = cx.tcx.hir_body(closure.body)
         && let Some(PatKind::Binding(_, binding, ..)) = body.params.first().map(|p| p.pat.kind)
     {
         let mut set_char_spans: Vec<Span> = Vec::new();