Skip to content

Commit 139952a

Browse files
committed
Fix build on nightly-2025-02-13
1 parent d167fbc commit 139952a

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/upgrade.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ impl Args {
207207

208208
/// Copies features from source dependency spec to new dependency table, if exists.
209209
fn copy_dependency_features(dest: &mut InlineTable, src: &Value) {
210-
if let Some(dep) = src.as_inline_table()
211-
&& let Some(features) = dep.get("features")
212-
{
213-
dest.insert("features", features.clone());
210+
if let Some(dep) = src.as_inline_table() {
211+
if let Some(features) = dep.get("features") {
212+
dest.insert("features", features.clone());
213+
}
214214
}
215215
}
216216

@@ -238,12 +238,13 @@ fn purge_unused_patches(cargo_toml: &mut DocumentMut) -> Result<()> {
238238
let sh = Shell::new()?;
239239
let cargo_lock = sh.read_file("Cargo.lock")?.parse::<DocumentMut>()?;
240240

241-
if let Some(unused_patches) = find_unused_patches(&cargo_lock)
242-
&& let Some(patch) = cargo_toml["patch"].as_table_mut()
243-
&& let Some(patch) = patch["crates-io"].as_table_mut()
244-
{
245-
// Remove any patches that are not for Cairo crates.
246-
patch.retain(|key, _| !unused_patches.contains(&key.to_owned()));
241+
if let Some(unused_patches) = find_unused_patches(&cargo_lock) {
242+
if let Some(patch) = cargo_toml["patch"].as_table_mut() {
243+
if let Some(patch) = patch["crates-io"].as_table_mut() {
244+
// Remove any patches that are not for Cairo crates.
245+
patch.retain(|key, _| !unused_patches.contains(&key.to_owned()));
246+
}
247+
}
247248
}
248249

249250
Ok(())

0 commit comments

Comments
 (0)