Skip to content

Commit

Permalink
Rollup merge of #114340 - ttsugriy:rustc-attr, r=lqd
Browse files Browse the repository at this point in the history
[rustc_attr][nit] Replace `filter` + `is_some` with `map_or`.

It's slightly shorter and better communicates the intent.
  • Loading branch information
matthiaskrgr committed Aug 2, 2023
2 parents 1778c58 + 9563eec commit 4876afb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4876afb

Please sign in to comment.