@@ -123,7 +123,8 @@ There are three ways to do this, depending on if the target trait has a
123123diagnostic item, lang item or neither.
124124
125125``` rust
126- use clippy_utils :: {implements_trait, is_trait_method, match_trait_method, paths};
126+ use clippy_utils :: ty :: implements_trait;
127+ use clippy_utils :: is_trait_method;
127128use rustc_span :: symbol :: sym;
128129
129130impl LateLintPass <'_ > for MyStructLint {
@@ -143,13 +144,6 @@ impl LateLintPass<'_> for MyStructLint {
143144 . map_or (false , | id | implements_trait (cx , ty , id , & [])) {
144145 // `expr` implements `Drop` trait
145146 }
146-
147- // 3. Using the type path with the expression
148- // we use `match_trait_method` function from Clippy's utils
149- // (This method should be avoided if possible)
150- if match_trait_method (cx , expr , & paths :: INTO ) {
151- // `expr` implements `Into` trait
152- }
153147 }
154148}
155149```
@@ -233,8 +227,9 @@ functions to deal with macros:
233227 crates
234228
235229 ``` rust
236- #[macro_use]
237- extern crate a_crate_with_macros;
230+ use rustc_middle :: lint :: in_external_macro;
231+
232+ use a_crate_with_macros :: foo;
238233
239234 // `foo` is defined in `a_crate_with_macros`
240235 foo! (" bar" );
0 commit comments