diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-22 22:14:38 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-22 22:14:38 +0100 |
commit | 27694abd9473c53cee4549dfe5ef5d28d0c01bed (patch) | |
tree | 6f51587dc28fc8fe28c0971a810541421ea2d829 /crates/ra_editor/src/scope | |
parent | 5a64b9a811554473e65db7e7ae515079ca48c70b (diff) | |
parent | dc9ce8ff7494f641c7102785cdef95489f2fc3d6 (diff) |
Merge #138
138: Fix some clippy lints r=matklad a=alanhdu
I went ahead and fixed all the clippy lints (there were a couple I thought would be better unfixed and added `cfg` statements to allow them) and also re-enabled clippy and rustfmt in CI.
They were disabled with `no time to explain, disable clippy checks`, so hopefully this won't go against whatever the reason at the time was :laughing:.
One question about the CI though: right now, it's an allowed failure that runs against the latest nightly each time. Would it be better to pin it to a specific nightly (or use the `beta` versions) to lower the churn?
Co-authored-by: Alan Du <[email protected]>
Diffstat (limited to 'crates/ra_editor/src/scope')
-rw-r--r-- | crates/ra_editor/src/scope/mod_scope.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_editor/src/scope/mod_scope.rs b/crates/ra_editor/src/scope/mod_scope.rs index 8d7e408f8..956ee0e2f 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), | 25 | ast::ModuleItem::StructDef(item) => Entry::new_item(item), |
26 | ast::ModuleItem::EnumDef(item) => Entry::new(item), | 26 | ast::ModuleItem::EnumDef(item) => Entry::new_item(item), |
27 | ast::ModuleItem::FnDef(item) => Entry::new(item), | 27 | ast::ModuleItem::FnDef(item) => Entry::new_item(item), |
28 | ast::ModuleItem::ConstDef(item) => Entry::new(item), | 28 | ast::ModuleItem::ConstDef(item) => Entry::new_item(item), |
29 | ast::ModuleItem::StaticDef(item) => Entry::new(item), | 29 | ast::ModuleItem::StaticDef(item) => Entry::new_item(item), |
30 | ast::ModuleItem::TraitDef(item) => Entry::new(item), | 30 | ast::ModuleItem::TraitDef(item) => Entry::new_item(item), |
31 | ast::ModuleItem::TypeDef(item) => Entry::new(item), | 31 | ast::ModuleItem::TypeDef(item) => Entry::new_item(item), |
32 | ast::ModuleItem::Module(item) => Entry::new(item), | 32 | ast::ModuleItem::Module(item) => Entry::new_item(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 | ||
52 | impl Entry { | 52 | impl Entry { |
53 | fn new<'a>(item: impl ast::NameOwner<'a>) -> Option<Entry> { | 53 | fn new_item<'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(), |