From 4beb1f35af09bcc53bdc173c3af79aeddeef42b8 Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Thu, 27 May 2021 18:07:35 -0700 Subject: [PATCH] Exclude global procs from parent var/proc linking Fixes #268. --- src/dmdoc/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dmdoc/main.rs b/src/dmdoc/main.rs index 49e9c78f..b13e5878 100644 --- a/src/dmdoc/main.rs +++ b/src/dmdoc/main.rs @@ -500,7 +500,7 @@ fn main2() -> Result<(), Box> { if !var.value.docs.is_empty() { // determine if there is a documented parent we can link to let mut parent = None; - let mut next = ty.parent_type(); + let mut next = ty.parent_type_without_root(); while let Some(current) = next { if let Some(entry) = current.vars.get(name) { if !entry.value.docs.is_empty() { @@ -508,7 +508,7 @@ fn main2() -> Result<(), Box> { break; } } - next = current.parent_type(); + next = current.parent_type_without_root(); } error_entity_put(format!("{}/var/{}", ty.path, name)); @@ -556,7 +556,7 @@ fn main2() -> Result<(), Box> { if !proc_value.docs.is_empty() { // determine if there is a documented parent we can link to let mut parent = None; - let mut next = ty.parent_type(); + let mut next = ty.parent_type_without_root(); while let Some(current) = next { if let Some(entry) = current.procs.get(name) { if !entry.main_value().docs.is_empty() { @@ -564,7 +564,7 @@ fn main2() -> Result<(), Box> { break; } } - next = current.parent_type(); + next = current.parent_type_without_root(); } error_entity_put(format!("{}/proc/{}", ty.path, name));