mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Optimize
This commit is contained in:
parent
43f09ad36c
commit
e0100e63ae
5 changed files with 28 additions and 13 deletions
|
@ -213,7 +213,9 @@ impl ModuleImplBlocks {
|
|||
match item {
|
||||
ast::ItemOrMacro::Item(ast::ModuleItem::ImplBlock(impl_block_ast)) => {
|
||||
let attrs = Attr::from_attrs_owner(file_id, &impl_block_ast, db);
|
||||
if attrs.iter().any(|attr| attr.is_cfg_enabled(cfg_options) == Some(false)) {
|
||||
if attrs.map_or(false, |attrs| {
|
||||
attrs.iter().any(|attr| attr.is_cfg_enabled(cfg_options) == Some(false))
|
||||
}) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -228,7 +230,9 @@ impl ModuleImplBlocks {
|
|||
ast::ItemOrMacro::Item(_) => (),
|
||||
ast::ItemOrMacro::Macro(macro_call) => {
|
||||
let attrs = Attr::from_attrs_owner(file_id, ¯o_call, db);
|
||||
if attrs.iter().any(|attr| attr.is_cfg_enabled(cfg_options) == Some(false)) {
|
||||
if attrs.map_or(false, |attrs| {
|
||||
attrs.iter().any(|attr| attr.is_cfg_enabled(cfg_options) == Some(false))
|
||||
}) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue