Skip to content

Commit d0d5aa9

Browse files
committed
Simplify
1 parent 254ef18 commit d0d5aa9

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

crates/ra_db/src/input.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,14 @@ impl CrateGraph {
142142
cfg_options: CfgOptions,
143143
env: Env,
144144
) -> CrateId {
145-
let data = CrateData::new(file_id, edition, display_name, cfg_options, env);
145+
let data = CrateData {
146+
root_file_id: file_id,
147+
edition,
148+
display_name,
149+
cfg_options,
150+
env,
151+
dependencies: Vec::new(),
152+
};
146153
let crate_id = CrateId(self.arena.len() as u32);
147154
let prev = self.arena.insert(crate_id, data);
148155
assert!(prev.is_none());
@@ -227,23 +234,6 @@ impl CrateId {
227234
}
228235

229236
impl CrateData {
230-
fn new(
231-
root_file_id: FileId,
232-
edition: Edition,
233-
display_name: Option<String>,
234-
cfg_options: CfgOptions,
235-
env: Env,
236-
) -> CrateData {
237-
CrateData {
238-
root_file_id,
239-
edition,
240-
display_name,
241-
dependencies: Vec::new(),
242-
cfg_options,
243-
env,
244-
}
245-
}
246-
247237
fn add_dep(&mut self, name: SmolStr, crate_id: CrateId) {
248238
self.dependencies.push(Dependency { name, crate_id })
249239
}

0 commit comments

Comments
 (0)