Skip to content

Commit 397bdb7

Browse files
committed
refactor(gctx): rename variable to reflect it is a toml doc
1 parent 49c9241 commit 397bdb7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cargo/util/context/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,19 +1464,19 @@ impl GlobalContext {
14641464
.with_context(|| format!("failed to load config from `{}`", str_path))?
14651465
} else {
14661466
let doc = toml_dotted_keys(arg)?;
1467-
let toml_v: toml::Value = toml::Value::deserialize(doc.into_deserializer())
1467+
let doc: toml::Value = toml::Value::deserialize(doc.into_deserializer())
14681468
.with_context(|| {
14691469
format!("failed to parse value from --config argument `{arg}`")
14701470
})?;
14711471

1472-
if toml_v
1472+
if doc
14731473
.get("registry")
14741474
.and_then(|v| v.as_table())
14751475
.and_then(|t| t.get("token"))
14761476
.is_some()
14771477
{
14781478
bail!("registry.token cannot be set through --config for security reasons");
1479-
} else if let Some((k, _)) = toml_v
1479+
} else if let Some((k, _)) = doc
14801480
.get("registries")
14811481
.and_then(|v| v.as_table())
14821482
.and_then(|t| t.iter().find(|(_, v)| v.get("token").is_some()))
@@ -1487,7 +1487,7 @@ impl GlobalContext {
14871487
);
14881488
}
14891489

1490-
if toml_v
1490+
if doc
14911491
.get("registry")
14921492
.and_then(|v| v.as_table())
14931493
.and_then(|t| t.get("secret-key"))
@@ -1496,7 +1496,7 @@ impl GlobalContext {
14961496
bail!(
14971497
"registry.secret-key cannot be set through --config for security reasons"
14981498
);
1499-
} else if let Some((k, _)) = toml_v
1499+
} else if let Some((k, _)) = doc
15001500
.get("registries")
15011501
.and_then(|v| v.as_table())
15021502
.and_then(|t| t.iter().find(|(_, v)| v.get("secret-key").is_some()))
@@ -1507,7 +1507,7 @@ impl GlobalContext {
15071507
);
15081508
}
15091509

1510-
CV::from_toml(Definition::Cli(None), toml_v)
1510+
CV::from_toml(Definition::Cli(None), doc)
15111511
.with_context(|| format!("failed to convert --config argument `{arg}`"))?
15121512
};
15131513
let tmp_table = self

0 commit comments

Comments
 (0)