Skip to content

Commit 6523a09

Browse files
committed
style
1 parent 0336e9b commit 6523a09

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

crates/hir_def/src/child_by_source.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ use crate::{
2020
pub trait ChildBySource {
2121
fn child_by_source(&self, db: &dyn DefDatabase, file_id: HirFileId) -> DynMap {
2222
let mut res = DynMap::default();
23-
self.child_by_source_to(db, file_id, &mut res);
23+
self.child_by_source_to(db, &mut res, file_id);
2424
res
2525
}
26-
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, map: &mut DynMap);
26+
fn child_by_source_to(&self, db: &dyn DefDatabase, map: &mut DynMap, file_id: HirFileId);
2727
}
2828

2929
impl ChildBySource for TraitId {
30-
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
30+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId) {
3131
let data = db.trait_data(*self);
32-
for &(_, item) in data.items.iter() {
33-
match item {
32+
for (_name, item) in data.items.iter() {
33+
match *item {
3434
AssocItemId::FunctionId(func) => {
3535
let loc = func.lookup(db);
3636
if loc.id.file_id() == file_id {
@@ -58,7 +58,7 @@ impl ChildBySource for TraitId {
5858
}
5959

6060
impl ChildBySource for ImplId {
61-
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
61+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId) {
6262
let data = db.impl_data(*self);
6363
for &item in data.items.iter() {
6464
match item {
@@ -89,15 +89,15 @@ impl ChildBySource for ImplId {
8989
}
9090

9191
impl ChildBySource for ModuleId {
92-
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
92+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId) {
9393
let def_map = self.def_map(db);
9494
let module_data = &def_map[self.local_id];
95-
module_data.scope.child_by_source_to(db, file_id, res);
95+
module_data.scope.child_by_source_to(db, res, file_id);
9696
}
9797
}
9898

9999
impl ChildBySource for ItemScope {
100-
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
100+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId) {
101101
self.declarations().for_each(|item| add_module_def(db, file_id, res, item));
102102
self.unnamed_consts().for_each(|konst| {
103103
let src = konst.lookup(db).source(db);
@@ -188,7 +188,7 @@ impl ChildBySource for ItemScope {
188188
}
189189

190190
impl ChildBySource for VariantId {
191-
fn child_by_source_to(&self, db: &dyn DefDatabase, _: HirFileId, res: &mut DynMap) {
191+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, _: HirFileId) {
192192
let arena_map = self.child_source(db);
193193
let arena_map = arena_map.as_ref();
194194
let parent = *self;
@@ -207,7 +207,7 @@ impl ChildBySource for VariantId {
207207
}
208208

209209
impl ChildBySource for EnumId {
210-
fn child_by_source_to(&self, db: &dyn DefDatabase, _: HirFileId, res: &mut DynMap) {
210+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, _: HirFileId) {
211211
let arena_map = self.child_source(db);
212212
let arena_map = arena_map.as_ref();
213213
for (local_id, source) in arena_map.value.iter() {
@@ -218,12 +218,12 @@ impl ChildBySource for EnumId {
218218
}
219219

220220
impl ChildBySource for DefWithBodyId {
221-
fn child_by_source_to(&self, db: &dyn DefDatabase, file_id: HirFileId, res: &mut DynMap) {
221+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId) {
222222
let body = db.body(*self);
223223
for (_, def_map) in body.blocks(db) {
224224
// All block expressions are merged into the same map, because they logically all add
225225
// inner items to the containing `DefWithBodyId`.
226-
def_map[def_map.root()].scope.child_by_source_to(db, file_id, res);
226+
def_map[def_map.root()].scope.child_by_source_to(db, res, file_id);
227227
}
228228
}
229229
}

crates/hir_def/src/generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ impl HasChildSource<LocalConstParamId> for GenericDefId {
438438
}
439439

440440
impl ChildBySource for GenericDefId {
441-
fn child_by_source_to(&self, db: &dyn DefDatabase, _: HirFileId, res: &mut DynMap) {
441+
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap, _: HirFileId) {
442442
let (_, sm) = GenericParams::new(db, *self);
443443

444444
let sm = sm.as_ref();

0 commit comments

Comments
 (0)