Skip to content

Commit c77edbf

Browse files
committed
refactor: rename parse_feature fn
1 parent 0b3ad41 commit c77edbf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cargo/core/features.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,8 @@ impl CliUnstable {
11481148
}
11491149
}
11501150

1151-
fn parse_features(value: Option<&str>) -> Vec<String> {
1151+
/// Parse a comma-separated list
1152+
fn parse_list(value: Option<&str>) -> Vec<String> {
11521153
match value {
11531154
None => Vec::new(),
11541155
Some("") => Vec::new(),
@@ -1197,7 +1198,7 @@ impl CliUnstable {
11971198
match k {
11981199
// Permanently unstable features
11991200
// Sorted alphabetically:
1200-
"allow-features" => self.allow_features = Some(parse_features(v).into_iter().collect()),
1201+
"allow-features" => self.allow_features = Some(parse_list(v).into_iter().collect()),
12011202
"print-im-a-teapot" => self.print_im_a_teapot = parse_bool(k, v)?,
12021203

12031204
// Stabilized features
@@ -1216,7 +1217,7 @@ impl CliUnstable {
12161217
// until we feel confident to remove entirely.
12171218
//
12181219
// See rust-lang/cargo#11168
1219-
let feats = parse_features(v);
1220+
let feats = parse_list(v);
12201221
let stab_is_not_empty = feats.iter().any(|feat| {
12211222
matches!(
12221223
feat.as_str(),
@@ -1259,7 +1260,7 @@ impl CliUnstable {
12591260
"build-std" => {
12601261
self.build_std = Some(crate::core::compiler::standard_lib::parse_unstable_flag(v))
12611262
}
1262-
"build-std-features" => self.build_std_features = Some(parse_features(v)),
1263+
"build-std-features" => self.build_std_features = Some(parse_list(v)),
12631264
"cargo-lints" => self.cargo_lints = parse_empty(k, v)?,
12641265
"codegen-backend" => self.codegen_backend = parse_empty(k, v)?,
12651266
"config-include" => self.config_include = parse_empty(k, v)?,

0 commit comments

Comments
 (0)