diff options
-rw-r--r-- | crates/ra_db/src/fixture.rs | 2 | ||||
-rw-r--r-- | crates/test_utils/src/fixture.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 20f291568..3959d7efe 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -110,7 +110,7 @@ fn with_single_file(db: &mut dyn SourceDatabaseExt, ra_fixture: &str) -> FileId | |||
110 | let source_root = SourceRoot::new_local(file_set); | 110 | let source_root = SourceRoot::new_local(file_set); |
111 | 111 | ||
112 | let crate_graph = if let Some(meta) = ra_fixture.lines().find(|it| it.contains("//-")) { | 112 | let crate_graph = if let Some(meta) = ra_fixture.lines().find(|it| it.contains("//-")) { |
113 | let entry = Fixture::parse_single(meta.trim()); | 113 | let entry = Fixture::parse_meta_line(meta.trim()); |
114 | let meta = match ParsedMeta::from(&entry) { | 114 | let meta = match ParsedMeta::from(&entry) { |
115 | ParsedMeta::File(it) => it, | 115 | ParsedMeta::File(it) => it, |
116 | }; | 116 | }; |
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index 0cd51ab3e..ba928bb9c 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -55,7 +55,7 @@ The offending line: {:?}"#, | |||
55 | let mut res: Vec<Fixture> = Vec::new(); | 55 | let mut res: Vec<Fixture> = Vec::new(); |
56 | for line in lines.by_ref() { | 56 | for line in lines.by_ref() { |
57 | if line.starts_with("//-") { | 57 | if line.starts_with("//-") { |
58 | let meta = Fixture::parse_single(line); | 58 | let meta = Fixture::parse_meta_line(line); |
59 | res.push(meta) | 59 | res.push(meta) |
60 | } else if let Some(entry) = res.last_mut() { | 60 | } else if let Some(entry) = res.last_mut() { |
61 | entry.text.push_str(line); | 61 | entry.text.push_str(line); |
@@ -66,7 +66,7 @@ The offending line: {:?}"#, | |||
66 | } | 66 | } |
67 | 67 | ||
68 | //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo | 68 | //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo |
69 | pub fn parse_single(meta: &str) -> Fixture { | 69 | pub fn parse_meta_line(meta: &str) -> Fixture { |
70 | assert!(meta.starts_with("//-")); | 70 | assert!(meta.starts_with("//-")); |
71 | let meta = meta["//-".len()..].trim(); | 71 | let meta = meta["//-".len()..].trim(); |
72 | let components = meta.split_ascii_whitespace().collect::<Vec<_>>(); | 72 | let components = meta.split_ascii_whitespace().collect::<Vec<_>>(); |