aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
authorvsrs <[email protected]>2020-05-16 11:17:21 +0100
committervsrs <[email protected]>2020-05-16 11:17:21 +0100
commit2dde9b19943d3f9557520428c92a52d75fb1deb3 (patch)
treeb787e8591b185c8fdc0947358b337e5462ba0d33 /crates/test_utils
parent256fb7556e9f4a329e673851427942c6403bacb6 (diff)
Use FixtureMeta in MockAnalysis
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs
index 6a8d06ea7..584ca5c39 100644
--- a/crates/test_utils/src/lib.rs
+++ b/crates/test_utils/src/lib.rs
@@ -176,7 +176,7 @@ pub struct FileMeta {
176 pub path: RelativePathBuf, 176 pub path: RelativePathBuf,
177 pub krate: Option<String>, 177 pub krate: Option<String>,
178 pub deps: Vec<String>, 178 pub deps: Vec<String>,
179 pub cfg: ra_cfg::CfgOptions, 179 pub cfg: CfgOptions,
180 pub edition: Option<String>, 180 pub edition: Option<String>,
181 pub env: FxHashMap<String, String>, 181 pub env: FxHashMap<String, String>,
182} 182}
@@ -188,6 +188,13 @@ impl FixtureMeta {
188 FixtureMeta::File(f) => &f.path, 188 FixtureMeta::File(f) => &f.path,
189 } 189 }
190 } 190 }
191
192 pub fn cfg_options(&self) -> Option<&CfgOptions> {
193 match self {
194 FixtureMeta::File(f) => Some(&f.cfg),
195 _ => None,
196 }
197 }
191} 198}
192 199
193/// Parses text which looks like this: 200/// Parses text which looks like this: