Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ jobs:
# Make sure CI fails on all warnings, including Clippy lints.
RUSTDOCFLAGS: "-Dwarnings"
- run: cargo test

check-nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2025-02-13"
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy on Scarb nightly version
run: cargo clippy --all-targets --all-features -- --no-deps
env:
# Make sure CI fails on all warnings, including Clippy lints.
RUSTFLAGS: "-Dwarnings"
udeps:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 11 additions & 10 deletions src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ impl Args {

/// Copies features from source dependency spec to new dependency table, if exists.
fn copy_dependency_features(dest: &mut InlineTable, src: &Value) {
if let Some(dep) = src.as_inline_table()
&& let Some(features) = dep.get("features")
{
dest.insert("features", features.clone());
if let Some(dep) = src.as_inline_table() {
if let Some(features) = dep.get("features") {
dest.insert("features", features.clone());
}
}
}

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

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

Ok(())
Expand Down
Loading