Make edition handling a bit nicer and allow specifying edition in crate_graph macro

This commit is contained in:
Florian Diebold 2019-02-13 20:31:27 +01:00
parent d5ad38cbb8
commit 70839b7ef8
5 changed files with 28 additions and 25 deletions

View file

@ -63,11 +63,7 @@ impl ProjectWorkspace {
for tgt in pkg.targets(&self.cargo) {
let root = tgt.root(&self.cargo);
if let Some(file_id) = load(root) {
let edition = if pkg.edition(&self.cargo) == "2015" {
Edition::Edition2015
} else {
Edition::Edition2018
};
let edition = pkg.edition(&self.cargo);
let crate_id = crate_graph.add_crate_root(file_id, edition);
if tgt.kind(&self.cargo) == TargetKind::Lib {
lib_tgt = Some(crate_id);