mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Use Default everywhere
This commit is contained in:
parent
cca5f862de
commit
f29b0172fb
7 changed files with 23 additions and 34 deletions
|
@ -86,22 +86,12 @@ impl Default for FileResolverImp {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
pub(crate) struct AnalysisHostImpl {
|
||||
db: db::RootDatabase,
|
||||
}
|
||||
|
||||
impl AnalysisHostImpl {
|
||||
pub fn new() -> AnalysisHostImpl {
|
||||
let mut db = db::RootDatabase::default();
|
||||
db.query_mut(crate::input::SourceRootQuery)
|
||||
.set(WORKSPACE, Default::default());
|
||||
db.query_mut(crate::input::CrateGraphQuery)
|
||||
.set((), Default::default());
|
||||
db.query_mut(crate::input::LibrariesQuery)
|
||||
.set((), Default::default());
|
||||
AnalysisHostImpl { db }
|
||||
}
|
||||
pub fn analysis(&self) -> AnalysisImpl {
|
||||
AnalysisImpl {
|
||||
db: self.db.snapshot(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue