use and_then/flat_map for map().flatten()

This commit is contained in:
Matthias Krüger 2023-04-01 23:50:45 +02:00
parent ac229c2819
commit 5a07e33d2c
5 changed files with 7 additions and 10 deletions

View file

@ -110,8 +110,6 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
body_id: LocalDefId,
tys: FxIndexSet<Ty<'tcx>>,
) -> Bounds<'a, 'tcx> {
tys.into_iter()
.map(move |ty| self.implied_outlives_bounds(param_env, body_id, ty))
.flatten()
tys.into_iter().flat_map(move |ty| self.implied_outlives_bounds(param_env, body_id, ty))
}
}