Rollup merge of #118288 - compiler-errors:is_some_and, r=lqd,dtolnay
Use `is_{some,ok}_and` more in the compiler slightly more fluent-reading code
This commit is contained in:
commit
8dd8db5073
8 changed files with 21 additions and 13 deletions
|
@ -552,7 +552,7 @@ impl UnsafeOpKind {
|
|||
) {
|
||||
let parent_id = tcx.hir().get_parent_item(hir_id);
|
||||
let parent_owner = tcx.hir().owner(parent_id);
|
||||
let should_suggest = parent_owner.fn_sig().map_or(false, |sig| sig.header.is_unsafe());
|
||||
let should_suggest = parent_owner.fn_sig().is_some_and(|sig| sig.header.is_unsafe());
|
||||
let unsafe_not_inherited_note = if should_suggest {
|
||||
suggest_unsafe_block.then(|| {
|
||||
let body_span = tcx.hir().body(parent_owner.body_id().unwrap()).value.span;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue