]> git.lizzy.rs Git - rust.git/blob - clippy_lints/src/methods/chars_last_cmp.rs
Auto merge of #7546 - mgeier:patch-1, r=giraffate
[rust.git] / clippy_lints / src / methods / chars_last_cmp.rs
1 use crate::methods::chars_cmp;
2 use rustc_lint::LateContext;
3
4 use super::CHARS_LAST_CMP;
5
6 /// Checks for the `CHARS_LAST_CMP` lint.
7 pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
8     if chars_cmp::check(cx, info, &["chars", "last"], CHARS_LAST_CMP, "ends_with") {
9         true
10     } else {
11         chars_cmp::check(cx, info, &["chars", "next_back"], CHARS_LAST_CMP, "ends_with")
12     }
13 }