Skip to content

Commit 5405152

Browse files
committed
Added note about the usage of clippy_utils::path
1 parent a276cd2 commit 5405152

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/common_tools_writing_lints.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ impl LateLintPass<'_> for MyStructLint {
105105
}
106106

107107
// 3. Using the type path
108+
// This method should be avoided if possible
108109
if match_def_path(cx, def_id, &paths::RESULT) {
109110
// The type is a `core::result::Result`
110111
}
@@ -142,6 +143,7 @@ impl LateLintPass<'_> for MyStructLint {
142143

143144
// 3. Using the type path with the expression
144145
// we use `match_trait_method` function from Clippy's utils
146+
// (This method should be avoided if possible)
145147
if match_trait_method(cx, expr, &paths::INTO) {
146148
// `expr` implements `Into` trait
147149
}

0 commit comments

Comments
 (0)