reformat the world

This commit is contained in:
Aleksey Kladov 2019-02-08 14:49:43 +03:00
parent 5cb1d41a30
commit 12e3b4c70b
129 changed files with 727 additions and 2509 deletions

View file

@ -72,10 +72,7 @@ impl NavigationTarget {
pub(crate) fn from_module(db: &RootDatabase, module: hir::Module) -> NavigationTarget {
let (file_id, source) = module.definition_source(db);
let name = module
.name(db)
.map(|it| it.to_string().into())
.unwrap_or_default();
let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default();
match source {
ModuleSource::SourceFile(node) => {
NavigationTarget::from_syntax(file_id, name, None, node.syntax())
@ -87,10 +84,7 @@ impl NavigationTarget {
}
pub(crate) fn from_module_to_decl(db: &RootDatabase, module: hir::Module) -> NavigationTarget {
let name = module
.name(db)
.map(|it| it.to_string().into())
.unwrap_or_default();
let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default();
if let Some((file_id, source)) = module.declaration_source(db) {
return NavigationTarget::from_syntax(file_id, name, None, source.syntax());
}