Skip to content

Commit cdcc86b

Browse files
committed
use the FnSig.inputs_and_output field directly
didn't realize it was `pub`
1 parent 2a5c16c commit cdcc86b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clippy_lints/src/needless_path_new.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPathNew {
9696
// if a generic is used in multiple places, we should better not touch it,
9797
// since we'd need to suggest changing both parameters that using it at once,
9898
// which might not be possible
99-
.filter(|g| {
100-
let inputs_and_output = sig.inputs().iter().copied().chain([sig.output()]);
101-
inputs_and_output.filter(|i| i.contains(*g)).count() < 2
102-
})
99+
.filter(|g| sig.inputs_and_output.into_iter().filter(|i| i.contains(*g)).count() < 2)
103100
// don't want to mess with the output type, since that probably has some additional
104101
// restrictions imposed from the outside, which we don't want to bother checking
105102
.filter(|g| !sig.output().contains(*g))

0 commit comments

Comments
 (0)