diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-08-02 06:22:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-02 06:22:50 +0200 |
| commit | 4876afba38cb645da498d35ad0a3be2452f6f6af (patch) | |
| tree | 63472255d5c60c923c331455f3335420e6f537a8 | |
| parent | 1778c58905ed4d17a352a1d3d7ff05e382a15a04 (diff) | |
| parent | 9563eec9a85107f8aae72adf43eaabb530a2836c (diff) | |
| download | rust-4876afba38cb645da498d35ad0a3be2452f6f6af.tar.gz rust-4876afba38cb645da498d35ad0a3be2452f6f6af.zip | |
Rollup merge of #114340 - ttsugriy:rustc-attr, r=lqd
[rustc_attr][nit] Replace `filter` + `is_some` with `map_or`. It's slightly shorter and better communicates the intent.
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 6cce3a56f08..6ed5fc77d75 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -28,7 +28,7 @@ pub fn rust_version_symbol() -> Symbol { } pub fn is_builtin_attr(attr: &Attribute) -> bool { - attr.is_doc_comment() || attr.ident().filter(|ident| is_builtin_attr_name(ident.name)).is_some() + attr.is_doc_comment() || attr.ident().is_some_and(|ident| is_builtin_attr_name(ident.name)) } enum AttrError { |
