internal: use API stabilized in 1.52

This commit is contained in:
Aleksey Kladov 2021-05-04 14:10:49 +03:00 committed by Kirill Bulatov
parent 3b4d5df840
commit 6a16ec52aa
7 changed files with 16 additions and 90 deletions

View file

@ -4,7 +4,6 @@
use std::str::FromStr;
use cfg::CfgOptions;
use stdx::split_once;
#[derive(Clone, Eq, PartialEq, Debug)]
pub enum CfgFlag {
@ -15,7 +14,7 @@ pub enum CfgFlag {
impl FromStr for CfgFlag {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let res = match split_once(s, '=') {
let res = match s.split_once('=') {
Some((key, value)) => {
if !(value.starts_with('"') && value.ends_with('"')) {
return Err(format!("Invalid cfg ({:?}), value should be in quotes", s));