Skip to content

Commit f8f55c7

Browse files
committed
Handle indented import groups
1 parent a0b4a3b commit f8f55c7

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/formatting/reorder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ fn rewrite_reorderable_or_regroupable_items(
256256
})
257257
.collect::<Option<Vec<_>>>()?;
258258

259-
Some(item_vec.join("\n\n"))
259+
let join_string = format!("\n\n{}", shape.indent.to_string(context.config));
260+
Some(item_vec.join(&join_string))
260261
}
261262
_ => {
262263
let list_items = itemize_list(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-group_imports: StdExternalCrate
2+
mod test {
3+
use crate::foo::bar;
4+
use std::path;
5+
use crate::foo::bar2;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// rustfmt-group_imports: StdExternalCrate
2+
mod test {
3+
use std::path;
4+
5+
use crate::foo::bar;
6+
use crate::foo::bar2;
7+
}

0 commit comments

Comments
 (0)