aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-06-23 17:20:32 +0100
committerAleksey Kladov <[email protected]>2020-06-23 17:37:26 +0100
commit30748161f0b4699ba9bc699a38ac9fc2fae49461 (patch)
treeeaa4c2ab2076ce6bb2b641edaaa971787aec1d69 /crates/ra_db
parent6996ec860bde7e6186ba8609b68ef51b8713e2ea (diff)
Simplify
Diffstat (limited to 'crates/ra_db')
-rw-r--r--crates/ra_db/src/fixture.rs30
1 files changed, 14 insertions, 16 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs
index bf897baff..7f006487a 100644
--- a/crates/ra_db/src/fixture.rs
+++ b/crates/ra_db/src/fixture.rs
@@ -61,7 +61,7 @@ use std::{str::FromStr, sync::Arc};
61 61
62use ra_cfg::CfgOptions; 62use ra_cfg::CfgOptions;
63use rustc_hash::FxHashMap; 63use rustc_hash::FxHashMap;
64use test_utils::{extract_offset, parse_fixture, parse_single_fixture, FixtureMeta, CURSOR_MARKER}; 64use test_utils::{extract_offset, parse_fixture, parse_single_fixture, CURSOR_MARKER};
65use vfs::{file_set::FileSet, VfsPath}; 65use vfs::{file_set::FileSet, VfsPath};
66 66
67use crate::{ 67use crate::{
@@ -243,20 +243,18 @@ struct FileMeta {
243 env: Env, 243 env: Env,
244} 244}
245 245
246impl From<&FixtureMeta> for ParsedMeta { 246impl From<&test_utils::FileMeta> for ParsedMeta {
247 fn from(meta: &FixtureMeta) -> Self { 247 fn from(f: &test_utils::FileMeta) -> Self {
248 match meta { 248 Self::File(FileMeta {
249 FixtureMeta::File(f) => Self::File(FileMeta { 249 path: f.path.to_owned(),
250 path: f.path.to_owned(), 250 krate: f.crate_name.to_owned(),
251 krate: f.crate_name.to_owned(), 251 deps: f.deps.to_owned(),
252 deps: f.deps.to_owned(), 252 cfg: f.cfg.to_owned(),
253 cfg: f.cfg.to_owned(), 253 edition: f
254 edition: f 254 .edition
255 .edition 255 .as_ref()
256 .as_ref() 256 .map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap()),
257 .map_or(Edition::Edition2018, |v| Edition::from_str(&v).unwrap()), 257 env: Env::from(f.env.iter()),
258 env: Env::from(f.env.iter()), 258 })
259 }),
260 }
261 } 259 }
262} 260}