Replace unnecessary map_or_else with map_or

This commit is contained in:
Dániel Buga 2020-10-18 10:59:03 +02:00
parent f3a0f68453
commit 2e99439900
2 changed files with 2 additions and 2 deletions

View file

@ -103,7 +103,7 @@ impl<'tcx> Place<'tcx> {
/// Returns the type of this `Place` after all projections have been applied.
pub fn ty(&self) -> Ty<'tcx> {
self.projections.last().map_or_else(|| self.base_ty, |proj| proj.ty)
self.projections.last().map_or(self.base_ty, |proj| proj.ty)
}
/// Returns the type of this `Place` immediately before `projection_index`th projection