We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
eq_method
1 parent 3ccda89 commit 3a02646Copy full SHA for 3a02646
clippy_lints/src/equatable_if_let.rs
@@ -53,9 +53,7 @@ pub(super) struct PatternEquality {
53
impl PatternEquality {
54
pub(super) fn new(tcx: TyCtxt<'_>, conf: &Conf) -> Self {
55
let eq_trait = tcx.lang_items().eq_trait();
56
- let eq_method = eq_trait
57
- .and_then(|eq_trait| tcx.provided_trait_methods(eq_trait).next())
58
- .map(|eq_method| eq_method.def_id);
+ let eq_method = eq_trait.and_then(|eq_trait| tcx.associated_item_def_ids(eq_trait).first().copied());
59
60
Self {
61
eq_trait,
0 commit comments