mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
reformat the world
This commit is contained in:
parent
5cb1d41a30
commit
12e3b4c70b
129 changed files with 727 additions and 2509 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue