Skip to content

Commit d0c1dd6

Browse files
rustdoc: clean up search index generator code
Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
1 parent fd7e5f8 commit d0c1dd6

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/librustdoc/html/render/search_index.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@ pub(crate) fn build_index<'tcx>(
185185
lastpathid,
186186
crate_paths,
187187
);
188-
if let Some(converted_associated_type) = converted_associated_type {
189-
*associated_type = converted_associated_type;
190-
} else {
188+
let Some(converted_associated_type) = converted_associated_type else {
191189
return false;
192-
}
190+
};
191+
*associated_type = converted_associated_type;
193192
for constraint in constraints {
194193
convert_render_type(
195194
constraint,
@@ -508,15 +507,9 @@ pub(crate) fn get_function_type_for_search<'tcx>(
508507
}
509508
});
510509
let (mut inputs, mut output, where_clause) = match *item.kind {
511-
clean::FunctionItem(ref f) => {
510+
clean::FunctionItem(ref f) | clean::MethodItem(ref f, _) | clean::TyMethodItem(ref f) => {
512511
get_fn_inputs_and_outputs(f, tcx, impl_or_trait_generics, cache)
513512
}
514-
clean::MethodItem(ref m, _) => {
515-
get_fn_inputs_and_outputs(m, tcx, impl_or_trait_generics, cache)
516-
}
517-
clean::TyMethodItem(ref m) => {
518-
get_fn_inputs_and_outputs(m, tcx, impl_or_trait_generics, cache)
519-
}
520513
_ => return None,
521514
};
522515

0 commit comments

Comments
 (0)