Skip to content

Commit c3edd33

Browse files
rustdoc: clean up search index generator code
Co-Authored-By: Guillaume Gomez <[email protected]>
1 parent 2a1f7fb commit c3edd33

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
@@ -187,11 +187,10 @@ pub(crate) fn build_index<'tcx>(
187187
lastpathid,
188188
crate_paths,
189189
);
190-
if let Some(converted_associated_type) = converted_associated_type {
191-
*associated_type = converted_associated_type;
192-
} else {
190+
let Some(converted_associated_type) = converted_associated_type else {
193191
return false;
194-
}
192+
};
193+
*associated_type = converted_associated_type;
195194
for constraint in constraints {
196195
convert_render_type(
197196
constraint,
@@ -537,15 +536,9 @@ pub(crate) fn get_function_type_for_search<'tcx>(
537536
}
538537
});
539538
let (mut inputs, mut output, where_clause) = match *item.kind {
540-
clean::FunctionItem(ref f) => {
539+
clean::FunctionItem(ref f) | clean::MethodItem(ref f, _) | clean::TyMethodItem(ref f) => {
541540
get_fn_inputs_and_outputs(f, tcx, impl_or_trait_generics, cache)
542541
}
543-
clean::MethodItem(ref m, _) => {
544-
get_fn_inputs_and_outputs(m, tcx, impl_or_trait_generics, cache)
545-
}
546-
clean::TyMethodItem(ref m) => {
547-
get_fn_inputs_and_outputs(m, tcx, impl_or_trait_generics, cache)
548-
}
549542
_ => return None,
550543
};
551544

0 commit comments

Comments
 (0)