Extract doc-comment on plugin functions.

This commit is contained in:
Stephen Chung
2021-12-21 16:14:07 +08:00
parent f74486f904
commit b85a9b3c1c
11 changed files with 275 additions and 21 deletions

View File

@@ -60,7 +60,7 @@ impl PartialOrd for FnParam<'_> {
Some(match self.name.partial_cmp(&other.name).expect("succeed") {
Ordering::Less => Ordering::Less,
Ordering::Greater => Ordering::Greater,
Ordering::Equal => self.typ.partial_cmp(other.typ).expect("succeed"),
Ordering::Equal => self.typ.partial_cmp(&other.typ).expect("succeed"),
})
}
}
@@ -162,7 +162,14 @@ impl<'a> From<&'a crate::module::FuncInfo> for FnMetadata<'a> {
.as_ref()
.map_or_else(|| Vec::new(), |v| v.iter().map(|s| &**s).collect())
} else {
Vec::new()
#[cfg(not(feature = "metadata"))]
{
Vec::new()
}
#[cfg(feature = "metadata")]
{
info.comments.split("\n").collect()
}
},
}
}