diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs index 5b48e5e1465d..195ba8340fd8 100644 --- a/src/librustdoc/html/render/search_index.rs +++ b/src/librustdoc/html/render/search_index.rs @@ -185,11 +185,10 @@ pub(crate) fn build_index<'tcx>( lastpathid, crate_paths, ); - if let Some(converted_associated_type) = converted_associated_type { - *associated_type = converted_associated_type; - } else { + let Some(converted_associated_type) = converted_associated_type else { return false; - } + }; + *associated_type = converted_associated_type; for constraint in constraints { convert_render_type( constraint, @@ -508,15 +507,9 @@ pub(crate) fn get_function_type_for_search<'tcx>( } }); let (mut inputs, mut output, where_clause) = match *item.kind { - clean::FunctionItem(ref f) => { + clean::FunctionItem(ref f) | clean::MethodItem(ref f, _) | clean::TyMethodItem(ref f) => { get_fn_inputs_and_outputs(f, tcx, impl_or_trait_generics, cache) } - clean::MethodItem(ref m, _) => { - get_fn_inputs_and_outputs(m, tcx, impl_or_trait_generics, cache) - } - clean::TyMethodItem(ref m) => { - get_fn_inputs_and_outputs(m, tcx, impl_or_trait_generics, cache) - } _ => return None, };