Skip to content

Commit 5b42bb1

Browse files
committed
Keep Cargo refusal checks lint-clean
Combine identical refusal branches for dotted dependencies without changing which declarations are refused. Full workspace Clippy and all 73 Cargo redirect tests pass. Assisted-by: Codex:gpt-6-astra
1 parent a156d87 commit 5b42bb1

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

  • crates/socket-patch-core/src/patch/redirect

‎crates/socket-patch-core/src/patch/redirect/mod.rs‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,16 +2151,13 @@ fn plan_cargo_toml(
21512151
let sub = parse_cargo_entry_key(dotted);
21522152
if sub.as_ref().is_some_and(|(key, _)| key == "workspace") {
21532153
pending.push(Pending::NeedsWorkspacePin(key.clone()));
2154-
} else if key == crate_name {
2155-
pending.push(Pending::Refuse(
2156-
"declared with dotted keys this rewriter does not edit".to_string(),
2157-
));
2158-
} else if sub
2159-
.filter(|(key, _)| key == "package")
2160-
.and_then(|(_, rest)| rest.trim_start().strip_prefix('='))
2161-
.and_then(cargo_toml_string)
2162-
.as_deref()
2163-
== Some(crate_name)
2154+
} else if key == crate_name
2155+
|| sub
2156+
.filter(|(key, _)| key == "package")
2157+
.and_then(|(_, rest)| rest.trim_start().strip_prefix('='))
2158+
.and_then(cargo_toml_string)
2159+
.as_deref()
2160+
== Some(crate_name)
21642161
{
21652162
pending.push(Pending::Refuse(
21662163
"declared with dotted keys this rewriter does not edit".to_string(),

0 commit comments

Comments
 (0)