Skip to content
Discussion options

You must be logged in to vote

Use the trait method path. Generics and UFCS are not supported:

disallowed-methods = [
  { path = "core::iter::Extend::extend", reason = "..." },
]

That one path covers every Extend::extend call (owned pairs, ref pairs, any type). Generics never go in the path.

You cannot limit it to only IndexMap today. heapless::index_map::IndexMap::extend only finds inherent methods, and <Type as Trait>::method is not parsed. Tracked here: #8581

Pitfall: a path that starts with < never resolves, and Clippy often skips the invalid-path warning because the first segment looks like an unloaded crate.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by asasine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants