diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 21:19:58 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 21:23:12 +0100 |
commit | be49547b446cba240f8f2a9592284e77d4a6896f (patch) | |
tree | de01434050b1fb9437dd519ca0d65229d52156a3 /crates/ra_project_model | |
parent | 239dd506f68db0cbe4417b6e5c7f737d8ff8a159 (diff) |
Use split_once polyfill
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r-- | crates/ra_project_model/src/cfg_flag.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_project_model/src/cfg_flag.rs b/crates/ra_project_model/src/cfg_flag.rs index 1bc5d4832..bd50056c6 100644 --- a/crates/ra_project_model/src/cfg_flag.rs +++ b/crates/ra_project_model/src/cfg_flag.rs | |||
@@ -4,7 +4,7 @@ | |||
4 | use std::str::FromStr; | 4 | use std::str::FromStr; |
5 | 5 | ||
6 | use ra_cfg::CfgOptions; | 6 | use ra_cfg::CfgOptions; |
7 | use stdx::split_delim; | 7 | use stdx::split_once; |
8 | 8 | ||
9 | #[derive(Clone, Eq, PartialEq, Debug)] | 9 | #[derive(Clone, Eq, PartialEq, Debug)] |
10 | pub enum CfgFlag { | 10 | pub enum CfgFlag { |
@@ -15,7 +15,7 @@ pub enum CfgFlag { | |||
15 | impl FromStr for CfgFlag { | 15 | impl FromStr for CfgFlag { |
16 | type Err = String; | 16 | type Err = String; |
17 | fn from_str(s: &str) -> Result<Self, Self::Err> { | 17 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
18 | let res = match split_delim(s, '=') { | 18 | let res = match split_once(s, '=') { |
19 | Some((key, value)) => { | 19 | Some((key, value)) => { |
20 | if !(value.starts_with('"') && value.ends_with('"')) { | 20 | if !(value.starts_with('"') && value.ends_with('"')) { |
21 | return Err(format!("Invalid cfg ({:?}), value should be in quotes", s)); | 21 | return Err(format!("Invalid cfg ({:?}), value should be in quotes", s)); |