mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 05:53:10 +00:00
Added note about the usage of clippy_utils::path
This commit is contained in:
parent
a276cd2a00
commit
540515220d
@ -105,6 +105,7 @@ impl LateLintPass<'_> for MyStructLint {
|
||||
}
|
||||
|
||||
// 3. Using the type path
|
||||
// This method should be avoided if possible
|
||||
if match_def_path(cx, def_id, &paths::RESULT) {
|
||||
// The type is a `core::result::Result`
|
||||
}
|
||||
@ -142,6 +143,7 @@ impl LateLintPass<'_> for MyStructLint {
|
||||
|
||||
// 3. Using the type path with the expression
|
||||
// we use `match_trait_method` function from Clippy's utils
|
||||
// (This method should be avoided if possible)
|
||||
if match_trait_method(cx, expr, &paths::INTO) {
|
||||
// `expr` implements `Into` trait
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user