[rustc_attr][nit] Replace filter + is_some with map_or.

It's slightly shorter and better communicates the intent.
This commit is contained in:
Taras Tsugrii 2023-08-01 11:52:47 -07:00
parent 4896daa398
commit 9563eec9a8

View File

@ -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 {