aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src
diff options
context:
space:
mode:
authorDmitry <[email protected]>2020-08-09 14:35:51 +0100
committerDmitry <[email protected]>2020-08-09 14:39:32 +0100
commit8068302fefc75440b823f4bf1731a5f347d7c767 (patch)
tree251b967182e79bc82a58c2fb208c688f6152df1f /crates/test_utils/src
parent1a43a0f63e0008787225abb6fb2baef97b6a39e0 (diff)
parent8a57afe5a4bfab40072a83f7dc4ca560bf860919 (diff)
Merge remote-tracking branch 'origin/master'
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 ed764046b..e40b61a94 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::{lines_with_ends, split_delim, trim_indent}; 5use stdx::{lines_with_ends, split_once, trim_indent};
6 6
7#[derive(Debug, Eq, PartialEq)] 7#[derive(Debug, Eq, PartialEq)]
8pub struct Fixture { 8pub struct Fixture {
@@ -71,14 +71,14 @@ impl Fixture {
71 let mut cfg_key_values = Vec::new(); 71 let mut cfg_key_values = Vec::new();
72 let mut env = FxHashMap::default(); 72 let mut env = FxHashMap::default();
73 for component in components[1..].iter() { 73 for component in components[1..].iter() {
74 let (key, value) = split_delim(component, ':').unwrap(); 74 let (key, value) = split_once(component, ':').unwrap();
75 match key { 75 match key {
76 "crate" => krate = Some(value.to_string()), 76 "crate" => krate = Some(value.to_string()),
77 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), 77 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
78 "edition" => edition = Some(value.to_string()), 78 "edition" => edition = Some(value.to_string()),
79 "cfg" => { 79 "cfg" => {
80 for entry in value.split(',') { 80 for entry in value.split(',') {
81 match split_delim(entry, '=') { 81 match split_once(entry, '=') {
82 Some((k, v)) => cfg_key_values.push((k.to_string(), v.to_string())), 82 Some((k, v)) => cfg_key_values.push((k.to_string(), v.to_string())),
83 None => cfg_atoms.push(entry.to_string()), 83 None => cfg_atoms.push(entry.to_string()),
84 } 84 }
@@ -86,7 +86,7 @@ impl Fixture {
86 } 86 }
87 "env" => { 87 "env" => {
88 for key in value.split(',') { 88 for key in value.split(',') {
89 if let Some((k, v)) = split_delim(key, '=') { 89 if let Some((k, v)) = split_once(key, '=') {
90 env.insert(k.into(), v.into()); 90 env.insert(k.into(), v.into());
91 } 91 }
92 } 92 }