1
Fork 0

Simplify code by using VecMap::get_by

This commit is contained in:
Santiago Pastorino 2021-06-08 09:41:26 -03:00
parent dd56ec653c
commit 1278f3f295
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
2 changed files with 65 additions and 73 deletions

View file

@ -1291,9 +1291,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
};
let concrete_ty = match concrete_opaque_types
.iter()
.find(|(key, _)| key.def_id == opaque_type_key.def_id)
.map(|(_, ty)| ty)
.get_by(|(key, _)| key.def_id == opaque_type_key.def_id)
{
None => {
if !concrete_is_opaque {