Skip to content

Commit 9563eec

Browse files
committed
[rustc_attr][nit] Replace filter + is_some with map_or.
It's slightly shorter and better communicates the intent.
1 parent 4896daa commit 9563eec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: 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)