Skip to content

Commit 982953a

Browse files
committed
chore: fmt
1 parent fb48e12 commit 982953a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

crates/ide-assists/src/handlers/auto_import.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ fn main() {
19031903
auto_import_all,
19041904
r"
19051905
mod foo { pub struct Foo; }
1906-
mod bar {
1906+
mod bar {
19071907
pub struct Bar;
19081908
fn use_foo(){
19091909
Foo$0;
@@ -1914,12 +1914,12 @@ fn main() {
19141914
Foo;
19151915
Bar;
19161916
}
1917-
", // FIXME(discord9): the resulting import have a strange whitespace after newline of the new import
1917+
",
19181918
r"
19191919
mod foo { pub struct Foo; }
19201920
mod bar {
19211921
use {crate::foo::Foo};
1922-
1922+
19231923
pub struct Bar;
19241924
fn use_foo(){
19251925
Foo;

crates/ide-db/src/imports/insert_use.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ fn insert_use_with_alias_option(
235235
insert_use_(scope, use_item, cfg.group);
236236
}
237237

238-
239238
/// Insert multiple uses with optional alias, notice this will not merge existing imports, and only happen within the same scope
240239
pub fn insert_multiple_use_with_alias_option(
241240
scope: &ImportScope,
@@ -244,7 +243,10 @@ pub fn insert_multiple_use_with_alias_option(
244243
) {
245244
let _p = tracing::info_span!("insert_use_with_alias_option").entered();
246245

247-
let use_trees = path_alias.iter().map(|(path, alias)| make::use_tree(path.clone(), None, alias.clone(), false)).collect::<Vec<_>>();
246+
let use_trees = path_alias
247+
.iter()
248+
.map(|(path, alias)| make::use_tree(path.clone(), None, alias.clone(), false))
249+
.collect::<Vec<_>>();
248250
let use_tree_list = make::use_tree_list(use_trees);
249251

250252
// make a `use ::{use_tree_list}`

crates/syntax/src/ast/make.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,7 @@ pub fn use_tree(
437437
}
438438
ast_from_text(&buf)
439439
}
440-
pub fn use_tree_from_tree_list(
441-
use_tree_list: ast::UseTreeList,
442-
) -> ast::UseTree {
440+
pub fn use_tree_from_tree_list(use_tree_list: ast::UseTreeList) -> ast::UseTree {
443441
let mut buf = "use ".to_owned();
444442
format_to!(buf, "{use_tree_list}");
445443

0 commit comments

Comments
 (0)