Skip to content

Commit 84f1660

Browse files
bors[bot]Veykril
andauthored
Merge #8220
8220: Reorder some ide_db imports r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents 97dbbad + 1ef5500 commit 84f1660

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

crates/ide_db/src/call_info/tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use crate::RootDatabase;
21
use base_db::{fixture::ChangeFixture, FilePosition};
32
use expect_test::{expect, Expect};
43
use test_utils::RangeOrOffset;
54

5+
use crate::RootDatabase;
6+
67
/// Creates analysis from a multi-file fixture, returns positions marked with $0.
78
pub(crate) fn position(ra_fixture: &str) -> (RootDatabase, FilePosition) {
89
let change_fixture = ChangeFixture::parse(ra_fixture);

crates/ide_db/src/helpers/insert_use.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Handle syntactic aspects of inserting a new `use`.
22
use std::{cmp::Ordering, iter::successors};
33

4-
use crate::RootDatabase;
54
use hir::Semantics;
65
use itertools::{EitherOrBoth, Itertools};
76
use syntax::{
@@ -14,6 +13,8 @@ use syntax::{
1413
AstToken, InsertPosition, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken,
1514
};
1615

16+
use crate::RootDatabase;
17+
1718
pub use hir::PrefixKind;
1819

1920
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

crates/ide_db/src/label.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! See `Label`
1+
//! See [`Label`]
22
use std::fmt;
33

44
/// A type to specify UI label, like an entry in the list of assists. Enforces

crates/ide_db/src/search.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ use once_cell::unsync::Lazy;
1212
use rustc_hash::FxHashMap;
1313
use syntax::{ast, match_ast, AstNode, TextRange, TextSize};
1414

15-
use crate::defs::NameClass;
1615
use crate::{
17-
defs::{Definition, NameRefClass},
16+
defs::{Definition, NameClass, NameRefClass},
1817
RootDatabase,
1918
};
2019

crates/ide_db/src/source_change.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ impl SourceChange {
3737
}
3838
}
3939

40+
/// Inserts a [`TextEdit`] for the given [`FileId`]. This properly handles merging existing
41+
/// edits for a file if some already exist.
4042
pub fn insert_source_edit(&mut self, file_id: FileId, edit: TextEdit) {
4143
match self.source_file_edits.entry(file_id) {
4244
Entry::Occupied(mut entry) => {

crates/ide_db/src/traits.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn get_missing_assoc_items(
6161
resolve_target_trait(sema, impl_def).map_or(vec![], |target_trait| {
6262
target_trait
6363
.items(sema.db)
64-
.iter()
64+
.into_iter()
6565
.filter(|i| match i {
6666
hir::AssocItem::Function(f) => {
6767
!impl_fns_consts.contains(&f.name(sema.db).to_string())
@@ -72,7 +72,6 @@ pub fn get_missing_assoc_items(
7272
.map(|n| !impl_fns_consts.contains(&n.to_string()))
7373
.unwrap_or_default(),
7474
})
75-
.cloned()
7675
.collect()
7776
})
7877
}

crates/ide_db/src/traits/tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
use crate::RootDatabase;
21
use base_db::{fixture::ChangeFixture, FilePosition};
32
use expect_test::{expect, Expect};
43
use hir::Semantics;
54
use syntax::ast::{self, AstNode};
65
use test_utils::RangeOrOffset;
76

7+
use crate::RootDatabase;
8+
89
/// Creates analysis from a multi-file fixture, returns positions marked with $0.
910
pub(crate) fn position(ra_fixture: &str) -> (RootDatabase, FilePosition) {
1011
let change_fixture = ChangeFixture::parse(ra_fixture);

crates/ide_db/src/ty_filter.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
//! Use case for structures in this module is, for example, situation when you need to process
33
//! only certain `Enum`s.
44
5-
use crate::RootDatabase;
6-
use hir::{Adt, Semantics, Type};
75
use std::iter;
6+
7+
use hir::{Adt, Semantics, Type};
88
use syntax::ast::{self, make};
99

10+
use crate::RootDatabase;
11+
1012
/// Enum types that implement `std::ops::Try` trait.
1113
#[derive(Clone, Copy)]
1214
pub enum TryEnum {

0 commit comments

Comments
 (0)