mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
[rustc_attr][nit] Replace filter
+ is_some
with map_or
.
It's slightly shorter and better communicates the intent.
This commit is contained in:
parent
4896daa398
commit
9563eec9a8
@ -28,7 +28,7 @@ pub fn rust_version_symbol() -> Symbol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_builtin_attr(attr: &Attribute) -> bool {
|
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 {
|
enum AttrError {
|
||||||
|
Loading…
Reference in New Issue
Block a user