From 30748161f0b4699ba9bc699a38ac9fc2fae49461 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 23 Jun 2020 18:20:32 +0200 Subject: Simplify --- crates/ra_ide/src/mock_analysis.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index 58fafecab..c0840c6ea 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs @@ -25,7 +25,7 @@ impl MockFileData { fn path(&self) -> &str { match self { MockFileData::Plain { path, .. } => path.as_str(), - MockFileData::Fixture(f) => f.meta.path(), + MockFileData::Fixture(f) => f.meta.path.as_str(), } } @@ -38,25 +38,25 @@ impl MockFileData { fn cfg_options(&self) -> CfgOptions { match self { - MockFileData::Fixture(f) => { - f.meta.cfg_options().map_or_else(Default::default, |o| o.clone()) - } + MockFileData::Fixture(f) => f.meta.cfg.clone(), _ => CfgOptions::default(), } } fn edition(&self) -> Edition { match self { - MockFileData::Fixture(f) => { - f.meta.edition().map_or(Edition::Edition2018, |v| Edition::from_str(v).unwrap()) - } + MockFileData::Fixture(f) => f + .meta + .edition + .as_ref() + .map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap()), _ => Edition::Edition2018, } } fn env(&self) -> Env { match self { - MockFileData::Fixture(f) => Env::from(f.meta.env()), + MockFileData::Fixture(f) => Env::from(f.meta.env.iter()), _ => Env::default(), } } -- cgit v1.2.3