From 546f031e4e643c7cc4df44a2a09ac7c4af5e5ad7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 25 Sep 2019 15:16:18 +0300 Subject: minor builder cleanups --- crates/ra_assists/src/assists/add_missing_impl_members.rs | 2 +- crates/ra_assists/src/assists/fill_match_arms.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_assists/src/assists') diff --git a/crates/ra_assists/src/assists/add_missing_impl_members.rs b/crates/ra_assists/src/assists/add_missing_impl_members.rs index 2894bdd8a..11d69a04b 100644 --- a/crates/ra_assists/src/assists/add_missing_impl_members.rs +++ b/crates/ra_assists/src/assists/add_missing_impl_members.rs @@ -103,7 +103,7 @@ fn add_body(fn_def: ast::FnDef) -> ast::FnDef { let mut ast_editor = AstEditor::new(fn_def.clone()); if fn_def.body().is_none() { ast_editor.set_body(&AstBuilder::::single_expr( - &AstBuilder::::unimplemented(), + AstBuilder::::unimplemented(), )); } ast_editor.ast().to_owned() diff --git a/crates/ra_assists/src/assists/fill_match_arms.rs b/crates/ra_assists/src/assists/fill_match_arms.rs index 771aa625f..f1c36b805 100644 --- a/crates/ra_assists/src/assists/fill_match_arms.rs +++ b/crates/ra_assists/src/assists/fill_match_arms.rs @@ -32,7 +32,7 @@ pub(crate) fn fill_match_arms(mut ctx: AssistCtx) -> Option::from_pieces( iter::once(pat), - &AstBuilder::::unit(), + AstBuilder::::unit(), ) }); let new_arm_list = AstBuilder::::from_arms(arms); @@ -66,7 +66,7 @@ fn resolve_enum_def( } fn build_pat(var: ast::EnumVariant) -> Option { - let path = &AstBuilder::::from_pieces(var.parent_enum().name()?, var.name()?); + let path = AstBuilder::::from_pieces(var.parent_enum().name()?, var.name()?); let pat: ast::Pat = match var.kind() { ast::StructKind::Tuple(field_list) => { @@ -77,7 +77,7 @@ fn build_pat(var: ast::EnumVariant) -> Option { ast::StructKind::Named(field_list) => { let pats = field_list .fields() - .map(|f| AstBuilder::::from_name(&f.name().unwrap()).into()); + .map(|f| AstBuilder::::from_name(f.name().unwrap()).into()); AstBuilder::::from_pieces(path, pats).into() } ast::StructKind::Unit => AstBuilder::::from_path(path).into(), -- cgit v1.2.3