mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Remove Option<...> from result of Crate::root_module
There doesn't seem to be any need for it, and removing it simplies several paths of code that depend on it.
This commit is contained in:
parent
6cde0b1aa0
commit
bf9b4578bb
8 changed files with 22 additions and 23 deletions
|
@ -72,7 +72,7 @@ impl AnalysisStatsCmd {
|
|||
shuffle(&mut rng, &mut krates);
|
||||
}
|
||||
for krate in krates {
|
||||
let module = krate.root_module(db).expect("crate without root module");
|
||||
let module = krate.root_module(db);
|
||||
let file_id = module.definition_source(db).file_id;
|
||||
let file_id = file_id.original_file(db);
|
||||
let source_root = db.file_source_root(file_id);
|
||||
|
|
|
@ -28,7 +28,7 @@ pub fn diagnostics(
|
|||
let mut work = Vec::new();
|
||||
let krates = Crate::all(db);
|
||||
for krate in krates {
|
||||
let module = krate.root_module(db).expect("crate without root module");
|
||||
let module = krate.root_module(db);
|
||||
let file_id = module.definition_source(db).file_id;
|
||||
let file_id = file_id.original_file(db);
|
||||
let source_root = db.file_source_root(file_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue