fix clippy::toplevel_ref_arg and ::manual_map
This commit is contained in:
parent
e6e956dade
commit
543f8bc38c
12 changed files with 42 additions and 70 deletions
|
@ -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>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue