Skip to content

Commit cbff35b

Browse files
committed
Rust: cargo clippy --no-deps --fix
1 parent b3ed09d commit cbff35b

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

rust/extractor/src/crate_graph.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -432,20 +432,18 @@ fn make_path(crate_graph: &CrateGraph, db: &dyn HirDatabase, item: impl HasModul
432432
loop {
433433
if module.is_block_module() {
434434
path.push("<block>".to_owned());
435+
} else if let Some(name) = module.name(db).map(|x| x.as_str().to_owned()).or_else(|| {
436+
module.as_crate_root().and_then(|k| {
437+
let krate = &crate_graph[k.krate()];
438+
krate
439+
.display_name
440+
.as_ref()
441+
.map(|x| x.canonical_name().to_string())
442+
})
443+
}) {
444+
path.push(name);
435445
} else {
436-
if let Some(name) = module.name(db).map(|x| x.as_str().to_owned()).or_else(|| {
437-
module.as_crate_root().and_then(|k| {
438-
let krate = &crate_graph[k.krate()];
439-
krate
440-
.display_name
441-
.as_ref()
442-
.map(|x| x.canonical_name().to_string())
443-
})
444-
}) {
445-
path.push(name);
446-
} else {
447-
path.push("<unnamed>".to_owned());
448-
}
446+
path.push("<unnamed>".to_owned());
449447
}
450448
if let Some(parent) = module.containing_module(db) {
451449
module = parent;

0 commit comments

Comments
 (0)