1
Fork 0

Use Option::map_or instead of .map(..).unwrap_or(..)

This commit is contained in:
LingMan 2021-01-11 20:45:33 +01:00
parent d03fe84169
commit a56bffb4f9
50 changed files with 67 additions and 79 deletions

View file

@ -535,7 +535,7 @@ fn polymorphize<'tcx>(
} else {
None
};
let has_upvars = upvars_ty.map(|ty| ty.tuple_fields().count() > 0).unwrap_or(false);
let has_upvars = upvars_ty.map_or(false, |ty| ty.tuple_fields().count() > 0);
debug!("polymorphize: upvars_ty={:?} has_upvars={:?}", upvars_ty, has_upvars);
struct PolymorphizationFolder<'tcx> {