is_{some,ok}_and

This commit is contained in:
Michael Goulet
2023-11-25 17:12:15 +00:00
parent fe3038f263
commit 079a2e865f
8 changed files with 21 additions and 13 deletions

View File

@@ -792,7 +792,7 @@ impl<'tcx> TyCtxt<'tcx> {
// If `extern_crate` is `None`, then the crate was injected (e.g., by the allocator).
// Treat that kind of crate as "indirect", since it's an implementation detail of
// the language.
|| self.extern_crate(key.as_def_id()).map_or(false, |e| e.is_direct())
|| self.extern_crate(key.as_def_id()).is_some_and(|e| e.is_direct())
}
}