mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-26 03:45:04 +00:00
Minor, rename
This commit is contained in:
parent
846ed08fba
commit
f2f69e75c8
2 changed files with 3 additions and 3 deletions
|
@ -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 source_root = SourceRoot::new_local(file_set);
|
||||||
|
|
||||||
let crate_graph = if let Some(meta) = ra_fixture.lines().find(|it| it.contains("//-")) {
|
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) {
|
let meta = match ParsedMeta::from(&entry) {
|
||||||
ParsedMeta::File(it) => it,
|
ParsedMeta::File(it) => it,
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@ The offending line: {:?}"#,
|
||||||
let mut res: Vec<Fixture> = Vec::new();
|
let mut res: Vec<Fixture> = Vec::new();
|
||||||
for line in lines.by_ref() {
|
for line in lines.by_ref() {
|
||||||
if line.starts_with("//-") {
|
if line.starts_with("//-") {
|
||||||
let meta = Fixture::parse_single(line);
|
let meta = Fixture::parse_meta_line(line);
|
||||||
res.push(meta)
|
res.push(meta)
|
||||||
} else if let Some(entry) = res.last_mut() {
|
} else if let Some(entry) = res.last_mut() {
|
||||||
entry.text.push_str(line);
|
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
|
//- /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("//-"));
|
assert!(meta.starts_with("//-"));
|
||||||
let meta = meta["//-".len()..].trim();
|
let meta = meta["//-".len()..].trim();
|
||||||
let components = meta.split_ascii_whitespace().collect::<Vec<_>>();
|
let components = meta.split_ascii_whitespace().collect::<Vec<_>>();
|
||||||
|
|
Loading…
Reference in a new issue