Skip to content

Commit

Permalink
rustdoc: clean up search index generator code
Browse files Browse the repository at this point in the history
Co-Authored-By: Guillaume Gomez <[email protected]>
  • Loading branch information
notriddle and GuillaumeGomez committed Oct 4, 2023
1 parent 3673c10 commit 1232d99
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/librustdoc/html/render/search_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
};

Expand Down

0 comments on commit 1232d99

Please sign in to comment.