about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/ast.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-05-24 14:19:22 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-05-24 14:20:41 +0000
commitfb0f74a8c9e8b8f488ec5894d5d314caebf4c662 (patch)
tree4cab4cc84de840cc4cce01f3627a979fed59c54c /compiler/rustc_ast/src/ast.rs
parent70db8369226c4d2386b25d66a49c8989247934bf (diff)
downloadrust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.tar.gz
rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.zip
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler
Diffstat (limited to 'compiler/rustc_ast/src/ast.rs')
-rw-r--r--compiler/rustc_ast/src/ast.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 43b429f6947..4360fbeb9bb 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -2391,10 +2391,10 @@ pub struct FnDecl {
 
 impl FnDecl {
     pub fn has_self(&self) -> bool {
-        self.inputs.get(0).map_or(false, Param::is_self)
+        self.inputs.get(0).is_some_and(Param::is_self)
     }
     pub fn c_variadic(&self) -> bool {
-        self.inputs.last().map_or(false, |arg| matches!(arg.ty.kind, TyKind::CVarArgs))
+        self.inputs.last().is_some_and(|arg| matches!(arg.ty.kind, TyKind::CVarArgs))
     }
 }