Use FixtureMeta in MockAnalysis

This commit is contained in:
vsrs 2020-05-16 13:17:21 +03:00
parent 256fb7556e
commit 2dde9b1994
2 changed files with 85 additions and 17 deletions

View file

@ -176,7 +176,7 @@ pub struct FileMeta {
pub path: RelativePathBuf,
pub krate: Option<String>,
pub deps: Vec<String>,
pub cfg: ra_cfg::CfgOptions,
pub cfg: CfgOptions,
pub edition: Option<String>,
pub env: FxHashMap<String, String>,
}
@ -188,6 +188,13 @@ impl FixtureMeta {
FixtureMeta::File(f) => &f.path,
}
}
pub fn cfg_options(&self) -> Option<&CfgOptions> {
match self {
FixtureMeta::File(f) => Some(&f.cfg),
_ => None,
}
}
}
/// Parses text which looks like this: