Don't record self parameter for static methods

This commit is contained in:
mitaa
2016-02-23 12:04:27 +01:00
parent be7196a793
commit 9d3bce38b4

View File

@@ -2734,18 +2734,19 @@ fn make_item_keywords(it: &clean::Item) -> String {
fn get_index_search_type(item: &clean::Item,
parent: Option<String>) -> Option<IndexItemFunctionType> {
let decl = match item.inner {
clean::FunctionItem(ref f) => &f.decl,
clean::MethodItem(ref m) => &m.decl,
clean::TyMethodItem(ref m) => &m.decl,
let (decl, selfty) = match item.inner {
clean::FunctionItem(ref f) => (&f.decl, None),
clean::MethodItem(ref m) => (&m.decl, Some(&m.self_)),
clean::TyMethodItem(ref m) => (&m.decl, Some(&m.self_)),
_ => return None
};
let mut inputs = Vec::new();
// Consider `self` an argument as well.
if let Some(name) = parent {
inputs.push(Type { name: Some(name.to_ascii_lowercase()) });
match parent.and_then(|p| selfty.map(|s| (p, s)) ) {
Some((_, &clean::SelfStatic)) | None => (),
Some((name, _)) => inputs.push(Type { name: Some(name.to_ascii_lowercase()) }),
}
inputs.extend(&mut decl.inputs.values.iter().map(|arg| {