From 52fd2c8e4858c548195edceb83c02437d2d28ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 6 Apr 2020 17:21:33 +0300 Subject: Fix unnecessary braces warnings --- crates/ra_ide/src/display/navigation_target.rs | 42 +++++++++++++------------- crates/ra_ide/src/display/structure.rs | 16 +++++----- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'crates/ra_ide/src/display') diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index d57451cc8..e61846995 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs @@ -399,17 +399,17 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option match_ast! { match node { - ast::FnDef(it) => { it.doc_comment_text() }, - ast::StructDef(it) => { it.doc_comment_text() }, - ast::EnumDef(it) => { it.doc_comment_text() }, - ast::TraitDef(it) => { it.doc_comment_text() }, - ast::Module(it) => { it.doc_comment_text() }, - ast::TypeAliasDef(it) => { it.doc_comment_text() }, - ast::ConstDef(it) => { it.doc_comment_text() }, - ast::StaticDef(it) => { it.doc_comment_text() }, - ast::RecordFieldDef(it) => { it.doc_comment_text() }, - ast::EnumVariant(it) => { it.doc_comment_text() }, - ast::MacroCall(it) => { it.doc_comment_text() }, + ast::FnDef(it) => it.doc_comment_text(), + ast::StructDef(it) => it.doc_comment_text(), + ast::EnumDef(it) => it.doc_comment_text(), + ast::TraitDef(it) => it.doc_comment_text(), + ast::Module(it) => it.doc_comment_text(), + ast::TypeAliasDef(it) => it.doc_comment_text(), + ast::ConstDef(it) => it.doc_comment_text(), + ast::StaticDef(it) => it.doc_comment_text(), + ast::RecordFieldDef(it) => it.doc_comment_text(), + ast::EnumVariant(it) => it.doc_comment_text(), + ast::MacroCall(it) => it.doc_comment_text(), _ => None, } } @@ -424,16 +424,16 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> match_ast! { match node { - ast::FnDef(it) => { it.short_label() }, - ast::StructDef(it) => { it.short_label() }, - ast::EnumDef(it) => { it.short_label() }, - ast::TraitDef(it) => { it.short_label() }, - ast::Module(it) => { it.short_label() }, - ast::TypeAliasDef(it) => { it.short_label() }, - ast::ConstDef(it) => { it.short_label() }, - ast::StaticDef(it) => { it.short_label() }, - ast::RecordFieldDef(it) => { it.short_label() }, - ast::EnumVariant(it) => { it.short_label() }, + ast::FnDef(it) => it.short_label(), + ast::StructDef(it) => it.short_label(), + ast::EnumDef(it) => it.short_label(), + ast::TraitDef(it) => it.short_label(), + ast::Module(it) => it.short_label(), + ast::TypeAliasDef(it) => it.short_label(), + ast::ConstDef(it) => it.short_label(), + ast::StaticDef(it) => it.short_label(), + ast::RecordFieldDef(it) => it.short_label(), + ast::EnumVariant(it) => it.short_label(), _ => None, } } diff --git a/crates/ra_ide/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs index 5774e9a8b..7a774785c 100644 --- a/crates/ra_ide/src/display/structure.rs +++ b/crates/ra_ide/src/display/structure.rs @@ -117,18 +117,18 @@ fn structure_node(node: &SyntaxNode) -> Option { decl_with_detail(it, Some(detail)) }, - ast::StructDef(it) => { decl(it) }, - ast::EnumDef(it) => { decl(it) }, - ast::EnumVariant(it) => { decl(it) }, - ast::TraitDef(it) => { decl(it) }, - ast::Module(it) => { decl(it) }, + ast::StructDef(it) => decl(it), + ast::EnumDef(it) => decl(it), + ast::EnumVariant(it) => decl(it), + ast::TraitDef(it) => decl(it), + ast::Module(it) => decl(it), ast::TypeAliasDef(it) => { let ty = it.type_ref(); decl_with_type_ref(it, ty) }, - ast::RecordFieldDef(it) => { decl_with_ascription(it) }, - ast::ConstDef(it) => { decl_with_ascription(it) }, - ast::StaticDef(it) => { decl_with_ascription(it) }, + ast::RecordFieldDef(it) => decl_with_ascription(it), + ast::ConstDef(it) => decl_with_ascription(it), + ast::StaticDef(it) => decl_with_ascription(it), ast::ImplDef(it) => { let target_type = it.target_type()?; let target_trait = it.target_trait(); -- cgit v1.2.3