Misc docs polishing (#6712)
* Fake modules for Rust std lib functions Signed-off-by: Nick Cameron <nrc@ncameron.org> * Include the missing @ in Rust std lib fns Signed-off-by: Nick Cameron <nrc@ncameron.org> * Move revolve and mirror2d to better modules Signed-off-by: Nick Cameron <nrc@ncameron.org> * Use docs from KCL mods for type summaries Signed-off-by: Nick Cameron <nrc@ncameron.org> * Use type docs to describe types from KCL std lib Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -307,6 +307,15 @@ impl DocData {
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn summary(&self) -> Option<&String> {
|
||||
match self {
|
||||
DocData::Fn(f) => f.summary.as_ref(),
|
||||
DocData::Const(c) => c.summary.as_ref(),
|
||||
DocData::Ty(t) => t.summary.as_ref(),
|
||||
DocData::Mod(m) => m.summary.as_ref(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -459,7 +468,6 @@ impl ModData {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn find_by_name(&self, name: &str) -> Option<&DocData> {
|
||||
if let Some(result) = self.children.values().find(|dd| dd.name() == name) {
|
||||
return Some(result);
|
||||
|
Reference in New Issue
Block a user