Minor, rename

This commit is contained in:
Aleksey Kladov 2020-06-23 21:45:40 +02:00
parent 846ed08fba
commit f2f69e75c8
2 changed files with 3 additions and 3 deletions

View file

@ -110,7 +110,7 @@ fn with_single_file(db: &mut dyn SourceDatabaseExt, ra_fixture: &str) -> FileId
let source_root = SourceRoot::new_local(file_set);
let crate_graph = if let Some(meta) = ra_fixture.lines().find(|it| it.contains("//-")) {
let entry = Fixture::parse_single(meta.trim());
let entry = Fixture::parse_meta_line(meta.trim());
let meta = match ParsedMeta::from(&entry) {
ParsedMeta::File(it) => it,
};

View file

@ -55,7 +55,7 @@ The offending line: {:?}"#,
let mut res: Vec<Fixture> = Vec::new();
for line in lines.by_ref() {
if line.starts_with("//-") {
let meta = Fixture::parse_single(line);
let meta = Fixture::parse_meta_line(line);
res.push(meta)
} else if let Some(entry) = res.last_mut() {
entry.text.push_str(line);
@ -66,7 +66,7 @@ The offending line: {:?}"#,
}
//- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo
pub fn parse_single(meta: &str) -> Fixture {
pub fn parse_meta_line(meta: &str) -> Fixture {
assert!(meta.starts_with("//-"));
let meta = meta["//-".len()..].trim();
let components = meta.split_ascii_whitespace().collect::<Vec<_>>();