Skip to content

Commit 254ef18

Browse files
committed
Minimize API
1 parent 0320ebd commit 254ef18

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

crates/ra_db/src/input.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ pub struct CrateData {
111111
/// This actual crate name can be different in a particular dependent crate
112112
/// or may even be missing for some cases, such as a dummy crate for the code snippet.
113113
pub display_name: Option<String>,
114-
cfg_options: CfgOptions,
115-
env: Env,
114+
pub cfg_options: CfgOptions,
115+
pub env: Env,
116116
pub dependencies: Vec<Dependency>,
117117
}
118118

@@ -149,10 +149,6 @@ impl CrateGraph {
149149
crate_id
150150
}
151151

152-
pub fn cfg_options(&self, crate_id: CrateId) -> &CfgOptions {
153-
&self.arena[&crate_id].cfg_options
154-
}
155-
156152
pub fn add_dep(
157153
&mut self,
158154
from: CrateId,

crates/ra_hir_def/src/nameres/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> C
5151
}
5252
}
5353

54-
let cfg_options = crate_graph.cfg_options(def_map.krate);
54+
let cfg_options = &crate_graph[def_map.krate].cfg_options;
5555

5656
let mut collector = DefCollector {
5757
db,

0 commit comments

Comments
 (0)