Skip to content

Commit df4f7fc

Browse files
committed
refactor: rename ConfigValue::list to string_list
It is only used for retriving string list for now. If we have needs for a generalized `list`, we add it later.
1 parent 1850029 commit df4f7fc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/cargo/util/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,7 @@ impl ConfigValue {
23562356
}
23572357
}
23582358

2359-
pub fn list(&self, key: &str) -> CargoResult<Vec<(String, Definition)>> {
2359+
pub fn string_list(&self, key: &str) -> CargoResult<Vec<(String, Definition)>> {
23602360
match self {
23612361
CV::List(list, _) => list
23622362
.iter()

src/cargo/util/context/target.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ fn parse_links_overrides(
173173
output.library_links.extend(links);
174174
}
175175
"rustc-link-lib" => {
176-
let list = value.list(key)?;
176+
let list = value.string_list(key)?;
177177
output
178178
.library_links
179179
.extend(list.iter().map(|v| v.0.clone()));
180180
}
181181
"rustc-link-search" => {
182-
let list = value.list(key)?;
182+
let list = value.string_list(key)?;
183183
output.library_paths.extend(
184184
list.iter()
185185
.map(|v| PathBuf::from(&v.0))
@@ -211,11 +211,11 @@ fn parse_links_overrides(
211211
output.linker_args.extend(args);
212212
}
213213
"rustc-cfg" => {
214-
let list = value.list(key)?;
214+
let list = value.string_list(key)?;
215215
output.cfgs.extend(list.iter().map(|v| v.0.clone()));
216216
}
217217
"rustc-check-cfg" => {
218-
let list = value.list(key)?;
218+
let list = value.string_list(key)?;
219219
output.check_cfgs.extend(list.iter().map(|v| v.0.clone()));
220220
}
221221
"rustc-env" => {
@@ -243,6 +243,6 @@ fn extra_link_args(
243243
key: &str,
244244
value: &CV,
245245
) -> CargoResult<Vec<(LinkArgTarget, String)>> {
246-
let args = value.list(key)?;
246+
let args = value.string_list(key)?;
247247
Ok(args.into_iter().map(|v| (link_type.clone(), v.0)).collect())
248248
}

0 commit comments

Comments
 (0)