@@ -210,7 +210,7 @@ fn in_async_function(tcx: ty::TyCtxt<'_>, hir_id: rustc_hir::HirId) -> bool {
210210 . chain ( tcx. hir ( ) . parent_iter ( hir_id) )
211211 . any ( |( _, node) | {
212212 node. fn_kind ( )
213- . map_or ( false , |fn_kind| fn_kind. asyncness ( ) . is_async ( ) )
213+ . is_some_and ( |fn_kind| fn_kind. asyncness ( ) . is_async ( ) )
214214 } )
215215}
216216
@@ -237,7 +237,7 @@ fn is_call_with_mut_ref<'tcx>(
237237 ..
238238 } = & terminator. kind
239239 // smoelius: `deref_mut` generates too much noise.
240- && func. const_fn_def ( ) . map_or ( true , |( def_id, _) | {
240+ && func. const_fn_def ( ) . is_none_or ( |( def_id, _) | {
241241 !cx. tcx . is_diagnostic_item ( sym:: deref_mut_method, def_id)
242242 } )
243243 && let ( locals, constants) = collect_locals_and_constants ( cx, mir, path, args. iter ( ) . map ( |arg| & arg. node ) )
@@ -314,12 +314,12 @@ fn collect_locals_and_constants<'tcx>(
314314 && let followed_widely = locals_widely. remove ( destination. local )
315315 && ( followed_narrowly || followed_widely)
316316 {
317- let width_preserving = func. const_fn_def ( ) . map_or ( false , |( def_id, _) | {
317+ let width_preserving = func. const_fn_def ( ) . is_some_and ( |( def_id, _) | {
318318 WIDTH_PRESERVING
319319 . iter ( )
320320 . any ( |path| match_def_path ( cx, def_id, path) )
321321 } ) ;
322- let widening = func. const_fn_def ( ) . map_or ( false , |( def_id, _) | {
322+ let widening = func. const_fn_def ( ) . is_some_and ( |( def_id, _) | {
323323 WIDENING . iter ( ) . any ( |path| match_def_path ( cx, def_id, path) )
324324 } ) ;
325325 for arg in args {
@@ -430,7 +430,7 @@ fn error_note(span: Option<Span>) -> impl FnOnce(&mut Diag<'_, ()>) {
430430#[ must_use]
431431fn enabled ( opt : & str ) -> bool {
432432 let key = env ! ( "CARGO_PKG_NAME" ) . to_uppercase ( ) + "_" + opt;
433- std:: env:: var ( key) . map_or ( false , |value| value != "0" )
433+ std:: env:: var ( key) . is_ok_and ( |value| value != "0" )
434434}
435435
436436#[ test]
0 commit comments