aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/mock_analysis.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs
index c0840c6ea..d480fcf62 100644
--- a/crates/ra_ide/src/mock_analysis.rs
+++ b/crates/ra_ide/src/mock_analysis.rs
@@ -25,7 +25,7 @@ impl MockFileData {
25 fn path(&self) -> &str { 25 fn path(&self) -> &str {
26 match self { 26 match self {
27 MockFileData::Plain { path, .. } => path.as_str(), 27 MockFileData::Plain { path, .. } => path.as_str(),
28 MockFileData::Fixture(f) => f.meta.path.as_str(), 28 MockFileData::Fixture(f) => f.path.as_str(),
29 } 29 }
30 } 30 }
31 31
@@ -38,25 +38,23 @@ impl MockFileData {
38 38
39 fn cfg_options(&self) -> CfgOptions { 39 fn cfg_options(&self) -> CfgOptions {
40 match self { 40 match self {
41 MockFileData::Fixture(f) => f.meta.cfg.clone(), 41 MockFileData::Fixture(f) => f.cfg.clone(),
42 _ => CfgOptions::default(), 42 _ => CfgOptions::default(),
43 } 43 }
44 } 44 }
45 45
46 fn edition(&self) -> Edition { 46 fn edition(&self) -> Edition {
47 match self { 47 match self {
48 MockFileData::Fixture(f) => f 48 MockFileData::Fixture(f) => {
49 .meta 49 f.edition.as_ref().map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap())
50 .edition 50 }
51 .as_ref()
52 .map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap()),
53 _ => Edition::Edition2018, 51 _ => Edition::Edition2018,
54 } 52 }
55 } 53 }
56 54
57 fn env(&self) -> Env { 55 fn env(&self) -> Env {
58 match self { 56 match self {
59 MockFileData::Fixture(f) => Env::from(f.meta.env.iter()), 57 MockFileData::Fixture(f) => Env::from(f.env.iter()),
60 _ => Env::default(), 58 _ => Env::default(),
61 } 59 }
62 } 60 }