]> git.lizzy.rs Git - rust.git/commit
Merge #5955
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Fri, 11 Sep 2020 14:01:20 +0000 (14:01 +0000)
committerGitHub <noreply@github.com>
Fri, 11 Sep 2020 14:01:20 +0000 (14:01 +0000)
commit568dc38b7b6474e225533ae63718c24b0561f48d
tree8cacf0d45fa3d33e48a1f8126d54f29eadb168ee
parent96e988fcc3be11acc89dc2c1957bc14e8f39c911
parent74b755d23366bcfa5437df25b023f5a2451e1ea6
Merge #5955

5955: Remove merge import code duplication r=jonas-schievink a=Veykril

This removes the code duplication caused by #5935, this also allows the assist to merge imports that have equal visibility and prevents merges of unequal visibility. This PR also fixes an iteration mistake in the mentioned PR:

Turns out I made a mistake when writing the `segment_iter` function, I was assuming that the `children` of a path will just be the segments, which is obviously not the case. This also brings insertion order of shorter paths in line with how `rustfmt` orders them.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>