aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-23 20:30:28 +0100
committerGitHub <[email protected]>2020-06-23 20:30:28 +0100
commit846ed08fba1331f1ca8d3512e7536c05784ae4bc (patch)
tree3799a6c66e23cfd5885ec074216af2ae2e8ac690 /crates/test_utils/src
parent9caf810129589327cc614936a97a10cedc6f03a9 (diff)
parentff687453a8a80da29ee7b0b4ad71871ff8b0523e (diff)
Merge #5012
5012: Slightly better name r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r--crates/test_utils/src/fixture.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs
index 9108e49d9..0cd51ab3e 100644
--- a/crates/test_utils/src/fixture.rs
+++ b/crates/test_utils/src/fixture.rs
@@ -2,7 +2,7 @@
2//! rust-analyzer database from a single string. 2//! rust-analyzer database from a single string.
3 3
4use rustc_hash::FxHashMap; 4use rustc_hash::FxHashMap;
5use stdx::split1; 5use stdx::split_delim;
6 6
7#[derive(Debug, Eq, PartialEq)] 7#[derive(Debug, Eq, PartialEq)]
8pub struct Fixture { 8pub struct Fixture {
@@ -81,14 +81,14 @@ The offending line: {:?}"#,
81 let mut cfg_key_values = Vec::new(); 81 let mut cfg_key_values = Vec::new();
82 let mut env = FxHashMap::default(); 82 let mut env = FxHashMap::default();
83 for component in components[1..].iter() { 83 for component in components[1..].iter() {
84 let (key, value) = split1(component, ':').unwrap(); 84 let (key, value) = split_delim(component, ':').unwrap();
85 match key { 85 match key {
86 "crate" => krate = Some(value.to_string()), 86 "crate" => krate = Some(value.to_string()),
87 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), 87 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
88 "edition" => edition = Some(value.to_string()), 88 "edition" => edition = Some(value.to_string()),
89 "cfg" => { 89 "cfg" => {
90 for entry in value.split(',') { 90 for entry in value.split(',') {
91 match split1(entry, '=') { 91 match split_delim(entry, '=') {
92 Some((k, v)) => cfg_key_values.push((k.to_string(), v.to_string())), 92 Some((k, v)) => cfg_key_values.push((k.to_string(), v.to_string())),
93 None => cfg_atoms.push(entry.to_string()), 93 None => cfg_atoms.push(entry.to_string()),
94 } 94 }
@@ -96,7 +96,7 @@ The offending line: {:?}"#,
96 } 96 }
97 "env" => { 97 "env" => {
98 for key in value.split(',') { 98 for key in value.split(',') {
99 if let Some((k, v)) = split1(key, '=') { 99 if let Some((k, v)) = split_delim(key, '=') {
100 env.insert(k.into(), v.into()); 100 env.insert(k.into(), v.into());
101 } 101 }
102 } 102 }