mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Deduplicate some code
This commit is contained in:
parent
bb0de88f24
commit
2ebf0c87c2
22 changed files with 299 additions and 234 deletions
|
@ -442,8 +442,7 @@ fn module_def_doctest(db: &RootDatabase, def: Definition) -> Option<Runnable> {
|
|||
.for_each(|name| format_to!(path, "{}::", name.display(db)));
|
||||
// This probably belongs to canonical_path?
|
||||
if let Some(assoc_item) = def.as_assoc_item(db) {
|
||||
if let hir::AssocItemContainer::Impl(imp) = assoc_item.container(db) {
|
||||
let ty = imp.self_ty(db);
|
||||
if let Some(ty) = assoc_item.implementing_ty(db) {
|
||||
if let Some(adt) = ty.as_adt() {
|
||||
let name = adt.name(db);
|
||||
let mut ty_args = ty.generic_parameters(db).peekable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue