From fb0f74a8c9e8b8f488ec5894d5d314caebf4c662 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 24 May 2023 14:19:22 +0000 Subject: Use `Option::is_some_and` and `Result::is_ok_and` in the compiler --- .../src/structured_errors/wrong_number_of_generic_args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_hir_analysis/src/structured_errors') diff --git a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs index 6d1a1634ab4..ee3457282d3 100644 --- a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs +++ b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs @@ -395,7 +395,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { ) -> String { let fn_sig = self.tcx.hir().get_if_local(self.def_id).and_then(hir::Node::fn_sig); let is_used_in_input = |def_id| { - fn_sig.map_or(false, |fn_sig| { + fn_sig.is_some_and(|fn_sig| { fn_sig.decl.inputs.iter().any(|ty| match ty.kind { hir::TyKind::Path(hir::QPath::Resolved( None, -- cgit 1.4.1-3-g733a5