diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:19:22 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:20:41 +0000 |
| commit | fb0f74a8c9e8b8f488ec5894d5d314caebf4c662 (patch) | |
| tree | 4cab4cc84de840cc4cce01f3627a979fed59c54c /compiler/rustc_parse/src/parser/attr_wrapper.rs | |
| parent | 70db8369226c4d2386b25d66a49c8989247934bf (diff) | |
| download | rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.tar.gz rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.zip | |
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler
Diffstat (limited to 'compiler/rustc_parse/src/parser/attr_wrapper.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/attr_wrapper.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs index b0ab0f10624..1e6ac54964f 100644 --- a/compiler/rustc_parse/src/parser/attr_wrapper.rs +++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs @@ -72,7 +72,7 @@ fn has_cfg_or_cfg_attr(attrs: &[Attribute]) -> bool { // Therefore, the absence of a literal `cfg` or `cfg_attr` guarantees that // we don't need to do any eager expansion. attrs.iter().any(|attr| { - attr.ident().map_or(false, |ident| ident.name == sym::cfg || ident.name == sym::cfg_attr) + attr.ident().is_some_and(|ident| ident.name == sym::cfg || ident.name == sym::cfg_attr) }) } |
