aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor
diff options
context:
space:
mode:
authorAlan Du <[email protected]>2018-10-20 17:29:25 +0100
committerAlan Du <[email protected]>2018-10-20 17:29:25 +0100
commit0857c22f263ff18418f939b57a7a2ab3f8aac2c1 (patch)
treef7a33b9fb8ddabe65c99f4db6a7d84c7a8463e16 /crates/ra_editor
parent6dd3fa6a947a4442e46ac042ff955a7f17bd6a0f (diff)
Revert "clippy: Fix new_ret_no_self"
This reverts commit 2ae9dfa812ccf18867373f77a106161378a6d91d.
Diffstat (limited to 'crates/ra_editor')
-rw-r--r--crates/ra_editor/src/scope/fn_scope.rs4
-rw-r--r--crates/ra_editor/src/scope/mod_scope.rs18
2 files changed, 11 insertions, 11 deletions
diff --git a/crates/ra_editor/src/scope/fn_scope.rs b/crates/ra_editor/src/scope/fn_scope.rs
index 84f036c7e..9088e5a60 100644
--- a/crates/ra_editor/src/scope/fn_scope.rs
+++ b/crates/ra_editor/src/scope/fn_scope.rs
@@ -63,7 +63,7 @@ impl FnScopes {
63 .syntax() 63 .syntax()
64 .descendants() 64 .descendants()
65 .filter_map(ast::BindPat::cast) 65 .filter_map(ast::BindPat::cast)
66 .filter_map(ScopeEntry::new_opt); 66 .filter_map(ScopeEntry::new);
67 self.scopes[scope].entries.extend(entries); 67 self.scopes[scope].entries.extend(entries);
68 } 68 }
69 fn add_params_bindings(&mut self, scope: ScopeId, params: Option<ast::ParamList>) { 69 fn add_params_bindings(&mut self, scope: ScopeId, params: Option<ast::ParamList>) {
@@ -88,7 +88,7 @@ pub struct ScopeEntry {
88} 88}
89 89
90impl ScopeEntry { 90impl ScopeEntry {
91 fn new_opt(pat: ast::BindPat) -> Option<ScopeEntry> { 91 fn new(pat: ast::BindPat) -> Option<ScopeEntry> {
92 if pat.name().is_some() { 92 if pat.name().is_some() {
93 Some(ScopeEntry { 93 Some(ScopeEntry {
94 syntax: pat.syntax().owned(), 94 syntax: pat.syntax().owned(),
diff --git a/crates/ra_editor/src/scope/mod_scope.rs b/crates/ra_editor/src/scope/mod_scope.rs
index 956ee0e2f..8d7e408f8 100644
--- a/crates/ra_editor/src/scope/mod_scope.rs
+++ b/crates/ra_editor/src/scope/mod_scope.rs
@@ -22,14 +22,14 @@ impl ModuleScope {
22 let mut entries = Vec::new(); 22 let mut entries = Vec::new();
23 for item in items { 23 for item in items {
24 let entry = match item { 24 let entry = match item {
25 ast::ModuleItem::StructDef(item) => Entry::new_item(item), 25 ast::ModuleItem::StructDef(item) => Entry::new(item),
26 ast::ModuleItem::EnumDef(item) => Entry::new_item(item), 26 ast::ModuleItem::EnumDef(item) => Entry::new(item),
27 ast::ModuleItem::FnDef(item) => Entry::new_item(item), 27 ast::ModuleItem::FnDef(item) => Entry::new(item),
28 ast::ModuleItem::ConstDef(item) => Entry::new_item(item), 28 ast::ModuleItem::ConstDef(item) => Entry::new(item),
29 ast::ModuleItem::StaticDef(item) => Entry::new_item(item), 29 ast::ModuleItem::StaticDef(item) => Entry::new(item),
30 ast::ModuleItem::TraitDef(item) => Entry::new_item(item), 30 ast::ModuleItem::TraitDef(item) => Entry::new(item),
31 ast::ModuleItem::TypeDef(item) => Entry::new_item(item), 31 ast::ModuleItem::TypeDef(item) => Entry::new(item),
32 ast::ModuleItem::Module(item) => Entry::new_item(item), 32 ast::ModuleItem::Module(item) => Entry::new(item),
33 ast::ModuleItem::UseItem(item) => { 33 ast::ModuleItem::UseItem(item) => {
34 if let Some(tree) = item.use_tree() { 34 if let Some(tree) = item.use_tree() {
35 collect_imports(tree, &mut entries); 35 collect_imports(tree, &mut entries);
@@ -50,7 +50,7 @@ impl ModuleScope {
50} 50}
51 51
52impl Entry { 52impl Entry {
53 fn new_item<'a>(item: impl ast::NameOwner<'a>) -> Option<Entry> { 53 fn new<'a>(item: impl ast::NameOwner<'a>) -> Option<Entry> {
54 let name = item.name()?; 54 let name = item.name()?;
55 Some(Entry { 55 Some(Entry {
56 node: name.syntax().owned(), 56 node: name.syntax().owned(),