Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4876afb

Browse files
authoredAug 2, 2023
Rollup merge of rust-lang#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.
2 parents 1778c58 + 9563eec commit 4876afb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎compiler/rustc_attr/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn rust_version_symbol() -> Symbol {
2828
}
2929

3030
pub fn is_builtin_attr(attr: &Attribute) -> bool {
31-
attr.is_doc_comment() || attr.ident().filter(|ident| is_builtin_attr_name(ident.name)).is_some()
31+
attr.is_doc_comment() || attr.ident().is_some_and(|ident| is_builtin_attr_name(ident.name))
3232
}
3333

3434
enum AttrError {

0 commit comments

Comments
 (0)
This repository has been archived.