From deb40d52aaa1989402fc01d65da389dc92fb66fa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Apr 2020 17:20:26 +0200 Subject: Align naming --- crates/ra_hir_def/src/adt.rs | 4 ++-- crates/ra_hir_def/src/body.rs | 2 +- crates/ra_hir_def/src/body/lower.rs | 3 +-- crates/ra_hir_def/src/data.rs | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 2619d106d..c7c3c0bc7 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs @@ -202,7 +202,7 @@ fn lower_struct( ast::StructKind::Tuple(fl) => { for (i, fd) in fl.fields().enumerate() { let attrs = expander.parse_attrs(&fd); - if !expander.check_cfg(&attrs) { + if !expander.is_cfg_enabled(&attrs) { continue; } @@ -220,7 +220,7 @@ fn lower_struct( ast::StructKind::Record(fl) => { for fd in fl.fields() { let attrs = expander.parse_attrs(&fd); - if !expander.check_cfg(&attrs) { + if !expander.is_cfg_enabled(&attrs) { continue; } diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 48b797dd6..7fe5403c0 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -118,7 +118,7 @@ impl Expander { Attrs::new(owner, &self.hygiene) } - pub(crate) fn check_cfg(&self, attrs: &Attrs) -> bool { + pub(crate) fn is_cfg_enabled(&self, attrs: &Attrs) -> bool { attrs.is_cfg_enabled(&self.cfg_options) } diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 6f56d3d7a..c1d7eb826 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -306,8 +306,7 @@ impl ExprCollector<'_> { .inspect(|field| field_ptrs.push(AstPtr::new(field))) .filter_map(|field| { let attrs = self.expander.parse_attrs(&field); - - if !self.expander.check_cfg(&attrs) { + if !self.expander.is_cfg_enabled(&attrs) { return None; } diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 446af9d9b..56a20c5bd 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs @@ -337,7 +337,7 @@ fn collect_impl_items( .filter_map(|item_node| match item_node { ast::ImplItem::FnDef(it) => { let attrs = expander.parse_attrs(&it); - if !expander.check_cfg(&attrs) { + if !expander.is_cfg_enabled(&attrs) { return None; } let def = FunctionLoc { -- cgit v1.2.3