Skip to content

Commit 8a5d78b

Browse files
pitiK3Uflip1995
authored andcommitted
Fix from_iter_instead_of_collect lint crashing on exprs without path segment
1 parent 1b117f4 commit 8a5d78b

File tree

1 file changed

+1
-2
lines changed
  • clippy_lints/src/methods

1 file changed

+1
-2
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,8 +1540,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
15401540
match expr.kind {
15411541
hir::ExprKind::Call(ref func, ref args) => {
15421542
if let hir::ExprKind::Path(path) = &func.kind {
1543-
let path_segment = last_path_segment(path);
1544-
if path_segment.ident.name.as_str() == "from_iter" {
1543+
if match_qpath(path, &["from_iter"]) {
15451544
lint_from_iter(cx, expr, args);
15461545
}
15471546
}

0 commit comments

Comments
 (0)