]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/clippy_lints/src/methods/chars_last_cmp_with_unwrap.rs
Auto merge of #105436 - nnethercote:inline-place_contents_drop_state_cannot_differ...
[rust.git] / src / tools / clippy / clippy_lints / src / methods / chars_last_cmp_with_unwrap.rs
1 use crate::methods::chars_cmp_with_unwrap;
2 use rustc_lint::LateContext;
3
4 use super::CHARS_LAST_CMP;
5
6 /// Checks for the `CHARS_LAST_CMP` lint with `unwrap()`.
7 pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
8     if chars_cmp_with_unwrap::check(cx, info, &["chars", "last", "unwrap"], CHARS_LAST_CMP, "ends_with") {
9         true
10     } else {
11         chars_cmp_with_unwrap::check(cx, info, &["chars", "next_back", "unwrap"], CHARS_LAST_CMP, "ends_with")
12     }
13 }