1
Fork 0

fix clippy::toplevel_ref_arg and ::manual_map

This commit is contained in:
Matthias Krüger 2023-04-15 20:18:30 +02:00
parent e6e956dade
commit 543f8bc38c
12 changed files with 42 additions and 70 deletions

View file

@ -243,16 +243,11 @@ pub fn get_vtable_index_of_object_method<'tcx, N>(
) -> Option<usize> {
// Count number of methods preceding the one we are selecting and
// add them to the total offset.
if let Some(index) = tcx
.own_existential_vtable_entries(object.upcast_trait_ref.def_id())
tcx.own_existential_vtable_entries(object.upcast_trait_ref.def_id())
.iter()
.copied()
.position(|def_id| def_id == method_def_id)
{
Some(object.vtable_base + index)
} else {
None
}
.map(|index| object.vtable_base + index)
}
pub fn closure_trait_ref_and_return_type<'tcx>(