]> git.lizzy.rs Git - rust.git/commitdiff
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)
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>

Trivial merge