rust-analyzer
rust-analyzer copied to clipboard
Feature Request: `unused-import` assist should remove unnecessary braces if only one import remains in the group after running
Let's say I have a situation like this:
use foo::bar::{baz, quxx};
^~~ unused import
If I use the "remove unused import" assist, I end up with
use foo::bar::{quux};
^~~~~^ remove unnecessary braces
So I have to trigger another assist immediately after removing the unused import, which is kinda silly.
It would be great if the unused import assist was smart enough to remove unnecessary braces here.
I can't check right now, but the first suggestion and fix are probably coming from rustc, not RA.
And you don't need to invoke the second one. If you have fornat on save enabled, rustfmt with remove the extra braces.