]> git.lizzy.rs Git - rust.git/commit
Merge #6287
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Tue, 3 Nov 2020 17:34:59 +0000 (17:34 +0000)
committerGitHub <noreply@github.com>
Tue, 3 Nov 2020 17:34:59 +0000 (17:34 +0000)
commit060c8b2c96a0de4a131c4d780d2aac80afe13de8
tree1c9c4d8b4134418dcf0dcfaf97d43c97d391f246
parent5e622332774fbd57c12addd46b058c8feb2b08a6
parentcd349dbbc4a39342fd54e46fc9d70e3e649a2fda
Merge #6287

6287: Don't replace entire module and file nodes when inserting imports r=matklad a=Veykril

This change minifies the resulting diff of import insertions by inserting or replacing the produced use tree directly through an `action` return value instead replacing the entire container node. This action has to be applied by the caller now. This unfortunately pulls the `AssistBuilder` into scope of `insert_use` back again but I tried to at least keep it away from the `insert_use` fn itself.

I'm open to more/better ideas regarding this :)

Fixes #6196

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