From 87af8bd610899fc25ba9f1c8a8392208b08a3863 Mon Sep 17 00:00:00 2001 From: faldor20 Date: Tue, 13 Feb 2024 20:39:42 +1000 Subject: [PATCH] clippy and formatting --- crates/lang_srv/src/analysis.rs | 5 ++--- crates/lang_srv/src/analysis/completion.rs | 4 ++-- crates/lang_srv/src/analysis/completion/formatting.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/lang_srv/src/analysis.rs b/crates/lang_srv/src/analysis.rs index 872780a50aa..5712dd4466b 100644 --- a/crates/lang_srv/src/analysis.rs +++ b/crates/lang_srv/src/analysis.rs @@ -320,7 +320,7 @@ impl<'a> AnalyzedDocumentBuilder<'a> { &mut self, imports: MutSet, ) -> HashMap>> { - let imports = imports + imports .into_iter() .map(|id| { ( @@ -332,8 +332,7 @@ impl<'a> AnalyzedDocumentBuilder<'a> { .clone(), ) }) - .collect::>(); - imports + .collect::>() } fn build_diagnostics( diff --git a/crates/lang_srv/src/analysis/completion.rs b/crates/lang_srv/src/analysis/completion.rs index 63d01b74a64..c9154c452bc 100644 --- a/crates/lang_srv/src/analysis/completion.rs +++ b/crates/lang_srv/src/analysis/completion.rs @@ -306,7 +306,7 @@ pub fn get_completion_items( subs: &mut Subs, module_id: &ModuleId, interns: &Interns, - exposed_imports: &Vec<(Symbol, Variable)>, + exposed_imports: &[(Symbol, Variable)], ) -> Vec { let mut completions = get_completions(position, decls, prefix, interns); completions.extend(exposed_imports); @@ -361,7 +361,7 @@ pub(super) fn get_module_completion_items( } fn get_module_exposed_completion( - exposed_symbols: &Vec<(Symbol, Variable)>, + exposed_symbols: &[(Symbol, Variable)], modules_info: &ModulesInfo, mod_id: &ModuleId, interns: &Interns, diff --git a/crates/lang_srv/src/analysis/completion/formatting.rs b/crates/lang_srv/src/analysis/completion/formatting.rs index eeddf58e087..aa3dfef446c 100644 --- a/crates/lang_srv/src/analysis/completion/formatting.rs +++ b/crates/lang_srv/src/analysis/completion/formatting.rs @@ -9,7 +9,7 @@ fn module_exposed_list( module_id: &ModuleId, interns: &Interns, modules_info: &ModulesInfo, - exposed: &Vec<(Symbol, Variable)>, + exposed: &[(Symbol, Variable)], ) -> Option { modules_info.with_subs(module_id, |subs| { let items = exposed @@ -38,7 +38,7 @@ pub(super) fn module_documentation( description_type: DescriptionsType, module_id: &ModuleId, interns: &Interns, - exposed: &Vec<(Symbol, Variable)>, + exposed: &[(Symbol, Variable)], modules_info: &ModulesInfo, ) -> Documentation { let exposed_string =