Skip to content
/ rust Public
forked from rust-lang/rust

Commit 4876afb

Browse files
authored
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

+1-1
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)