mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Remove code duplication
This commit is contained in:
parent
b8eb1597c9
commit
55356332bf
2 changed files with 2 additions and 5 deletions
|
@ -93,6 +93,7 @@ impl Attrs {
|
|||
}
|
||||
|
||||
pub(crate) fn is_cfg_enabled(&self, cfg_options: &CfgOptions) -> bool {
|
||||
// FIXME: handle cfg_attr :-)
|
||||
self.by_key("cfg").tt_values().all(|tt| cfg_options.is_cfg_enabled(tt) != Some(false))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -977,11 +977,7 @@ impl ModCollector<'_, '_> {
|
|||
}
|
||||
|
||||
fn is_cfg_enabled(&self, attrs: &Attrs) -> bool {
|
||||
// FIXME: handle cfg_attr :-)
|
||||
attrs
|
||||
.by_key("cfg")
|
||||
.tt_values()
|
||||
.all(|tt| self.def_collector.cfg_options.is_cfg_enabled(tt) != Some(false))
|
||||
attrs.is_cfg_enabled(self.def_collector.cfg_options)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue