From 12e3b4c70b5ef23b2fdfc197296d483680e125f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Feb 2019 14:49:43 +0300 Subject: reformat the world --- crates/ra_hir/src/ty/method_resolution.rs | 30 ++++++++++-------------------- crates/ra_hir/src/ty/tests.rs | 9 ++------- 2 files changed, 12 insertions(+), 27 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index a7d4517ee..da7587f01 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs @@ -46,18 +46,13 @@ impl CrateImplBlocks { ty: &Ty, ) -> impl Iterator + 'a { let fingerprint = TyFingerprint::for_impl(ty); - fingerprint - .and_then(|f| self.impls.get(&f)) - .into_iter() - .flat_map(|i| i.iter()) - .map(move |(module_id, impl_id)| { - let module = Module { - krate: self.krate, - module_id: *module_id, - }; + fingerprint.and_then(|f| self.impls.get(&f)).into_iter().flat_map(|i| i.iter()).map( + move |(module_id, impl_id)| { + let module = Module { krate: self.krate, module_id: *module_id }; let module_impl_blocks = db.impls_in_module(module); (module, ImplBlock::from_id(module_impl_blocks, *impl_id)) - }) + }, + ) } pub fn lookup_impl_blocks_for_trait<'a>( @@ -66,18 +61,13 @@ impl CrateImplBlocks { tr: &Trait, ) -> impl Iterator + 'a { let id = tr.id; - self.impls_by_trait - .get(&id) - .into_iter() - .flat_map(|i| i.iter()) - .map(move |(module_id, impl_id)| { - let module = Module { - krate: self.krate, - module_id: *module_id, - }; + self.impls_by_trait.get(&id).into_iter().flat_map(|i| i.iter()).map( + move |(module_id, impl_id)| { + let module = Module { krate: self.krate, module_id: *module_id }; let module_impl_blocks = db.impls_in_module(module); (module, ImplBlock::from_id(module_impl_blocks, *impl_id)) - }) + }, + ) } fn collect_recursive(&mut self, db: &impl HirDatabase, module: &Module) { diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 30da8fc23..2621d1b55 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -634,11 +634,7 @@ fn infer(content: &str) -> String { let (db, _, file_id) = MockDatabase::with_single_file(content); let source_file = db.parse(file_id); let mut acc = String::new(); - for fn_def in source_file - .syntax() - .descendants() - .filter_map(ast::FnDef::cast) - { + for fn_def in source_file.syntax().descendants().filter_map(ast::FnDef::cast) { let func = source_binder::function_from_source(&db, file_id, fn_def).unwrap(); let inference_result = func.infer(&db); let body_syntax_mapping = func.body_syntax_mapping(&db); @@ -725,8 +721,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { " .to_string(); - db.query_mut(ra_db::FileTextQuery) - .set(pos.file_id, Arc::new(new_text)); + db.query_mut(ra_db::FileTextQuery).set(pos.file_id, Arc::new(new_text)); { let events = db.log_executed(|| { -- cgit v1.2.3