Rustfmt: kill duplicates, without merge_imports?

What I like about merge_imports is that I can put all the use ... together in a blob, and it'll delete the duplicates for me.

What I don't like is that it creates a tree, i.e. it produces

pub use self:: {
  foo:: { ... },
  bar::{ ... },

whereas I would prefer a

pub use self::foo::{...};
pub use self::bar::{...};

Is there a way in rustfmt to (1) kill duplicates and (2) leave it in a 'linear' rather than a 'tree' form?

i think that's this issue merge_imports should be a little more conservative · Issue #2982 · rust-lang/rustfmt · GitHub (so it seems not, at the moment)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.