mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
internal: use API stabilized in 1.52
This commit is contained in:
parent
3b4d5df840
commit
6a16ec52aa
7 changed files with 16 additions and 90 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue