diff options
author | Aleksey Kladov <[email protected]> | 2018-11-04 11:09:21 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-04 11:09:21 +0000 |
commit | f29b0172fbcbc88160980c2e7359f92d7c0d885d (patch) | |
tree | 4ec1f709d283d3ea0b7c225a70f6439d67a5ca32 /crates/ra_analysis/src/imp.rs | |
parent | cca5f862de8a4eb4a8990fdca95a4a7686937789 (diff) |
Use Default everywhere
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 77dd71dcf..4f337d163 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -86,22 +86,12 @@ impl Default for FileResolverImp { | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | #[derive(Debug)] | 89 | #[derive(Debug, Default)] |
90 | pub(crate) struct AnalysisHostImpl { | 90 | pub(crate) struct AnalysisHostImpl { |
91 | db: db::RootDatabase, | 91 | db: db::RootDatabase, |
92 | } | 92 | } |
93 | 93 | ||
94 | impl AnalysisHostImpl { | 94 | impl AnalysisHostImpl { |
95 | pub fn new() -> AnalysisHostImpl { | ||
96 | let mut db = db::RootDatabase::default(); | ||
97 | db.query_mut(crate::input::SourceRootQuery) | ||
98 | .set(WORKSPACE, Default::default()); | ||
99 | db.query_mut(crate::input::CrateGraphQuery) | ||
100 | .set((), Default::default()); | ||
101 | db.query_mut(crate::input::LibrariesQuery) | ||
102 | .set((), Default::default()); | ||
103 | AnalysisHostImpl { db } | ||
104 | } | ||
105 | pub fn analysis(&self) -> AnalysisImpl { | 95 | pub fn analysis(&self) -> AnalysisImpl { |
106 | AnalysisImpl { | 96 | AnalysisImpl { |
107 | db: self.db.snapshot(), | 97 | db: self.db.snapshot(), |