From c91050a6bb8ca063391c9e2dd5573e1d3c1510f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 26 Oct 2026 00:27:15 +0000 Subject: [PATCH 1/3] [create-pull-request] automated change --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 99e619bb8..abc362744 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.98.1" +channel = "1.99.1" profile = "default" From 8526bbf46a105b2486d06cd3e6bf804733d30e07 Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Wed, 28 Oct 2026 11:04:50 +0000 Subject: [PATCH 2/3] Fix clippy errors --- Cargo.toml | 20 ++++++++++---------- src/asset/pool.rs | 16 ++++++++-------- src/example.rs | 2 +- src/settings.rs | 2 +- src/simulation/investment.rs | 2 +- src/simulation/optimisation.rs | 4 ++-- src/simulation/optimisation/constraints.rs | 5 ++++- tests/cli.rs | 2 +- 8 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ad66378d0..ee6ad13cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,21 +17,21 @@ csv = "1.4.0" log = "0.4.32" float-cmp = "0.10.0" itertools = "0.15.0" -serde = { version = "1.0.228", features = ["derive", "rc"] } +serde = {version = "1.0.228", features = ["derive", "rc"]} tempfile = "3.27.0" toml = "1.1.2" -fern = { version = "0.7.1", features = ["chrono", "colored"] } +fern = {version = "0.7.1", features = ["chrono", "colored"]} chrono = "0.4" -clap = { version = "4.6.1", features = ["cargo", "derive"] } +clap = {version = "4.6.1", features = ["cargo", "derive"]} include_dir = "0.7.4" highs = "2.4.0" indexmap = "2.14.0" human-panic = "2.0.8" clap-markdown = "0.1.5" platform-info = "2.1.0" -derive_more = { version = "2.1", features = ["add", "add_assign", "not", "deref", "display", "sum", "from_str", "from", "into"] } +derive_more = {version = "2.1", features = ["add", "add_assign", "not", "deref", "display", "sum", "from_str", "from", "into"]} petgraph = "0.8.3" -strum = { version = "0.28.0", features = ["derive"] } +strum = {version = "0.28.0", features = ["derive"]} documented = "0.10.0" dirs = "7.0.0" edit = "0.1.5" @@ -45,17 +45,17 @@ assert_cmd = "2.2.2" colored = "3.0.0" criterion = "0.8.2" ordered-float = "5.1.0" -rstest = { version = "0.27.0", default-features = false, features = ["crate-name"] } +rstest = {version = "0.27.0", default-features = false, features = ["crate-name"]} similar = "3.1.0" -yaml-rust2 = { version = "0.13.0", default-features = false } +yaml-rust2 = {version = "0.13.0", default-features = false} [build-dependencies] -built = { version = "0.8.1", features = ["chrono", "git2"] } +built = {version = "0.8.1", features = ["chrono", "git2"]} [lints.clippy] # Disallow lints from "all" and "pedantic" groups by default -all = { level = "deny", priority = -1 } -pedantic = { level = "deny", priority = -1 } +all = {level = "deny", priority = -1} +pedantic = {level = "deny", priority = -1} # Extra lints to disallow redundant_test_prefix = "deny" assertions_on_result_states = "deny" diff --git a/src/asset/pool.rs b/src/asset/pool.rs index 5b0fd9f18..741897513 100644 --- a/src/asset/pool.rs +++ b/src/asset/pool.rs @@ -231,7 +231,7 @@ mod tests { #[rstest] fn asset_pool_new() { - assert!(AssetPool::new().assets.is_empty()); + assert_eq!(AssetPool::new().assets, []); } #[rstest] @@ -263,9 +263,9 @@ mod tests { let commission_year = multi_tranche_asset.commission_year; let mut asset_pool = AssetPool::new(); let mut user_assets = vec![multi_tranche_asset.into()]; - assert!(asset_pool.assets.is_empty()); + assert_eq!(asset_pool.assets, []); asset_pool.commission_new(commission_year, &mut user_assets); - assert!(user_assets.is_empty()); + assert_eq!(user_assets, []); assert_eq!(asset_pool.assets.len(), 1); assert_eq!(asset_pool.next_id, 1); } @@ -274,16 +274,16 @@ mod tests { fn asset_pool_commission_already_decommissioned(asset: Asset) { let year = asset.max_decommission_year(); let mut asset_pool = AssetPool::new(); - assert!(asset_pool.assets.is_empty()); + assert_eq!(asset_pool.assets, []); asset_pool.commission_new(year, &mut vec![asset.into()]); - assert!(asset_pool.assets.is_empty()); + assert_eq!(asset_pool.assets, []); } #[rstest] fn asset_pool_decommission_old(mut user_assets: Vec) { let mut asset_pool = AssetPool::new(); asset_pool.commission_new(2020, &mut user_assets); - assert!(user_assets.is_empty()); + assert_eq!(user_assets, []); assert_eq!(asset_pool.assets.len(), 2); // should decommission first asset (lifetime == 5) @@ -298,7 +298,7 @@ mod tests { // should decommission second asset asset_pool.decommission_old(2040); - assert!(asset_pool.assets.is_empty()); + assert_eq!(asset_pool.assets, []); } #[rstest] @@ -691,6 +691,6 @@ mod tests { asset_pool.decommission_mothballed(2025, 10); - assert!(asset_pool.assets.is_empty()); + assert_eq!(asset_pool.assets, []); } } diff --git a/src/example.rs b/src/example.rs index e084976df..00414f424 100644 --- a/src/example.rs +++ b/src/example.rs @@ -76,7 +76,7 @@ mod tests { .with_context(|| format!("Could not load readme for {example}")) .unwrap(); - assert!(!readme.trim().is_empty()); + assert_ne!(readme.trim(), ""); } } } diff --git a/src/settings.rs b/src/settings.rs index 6fe834e8e..538dfd838 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -165,6 +165,6 @@ mod tests { #[test] fn default_file_contents() { - assert!(!Settings::default_file_contents().is_empty()); + assert_ne!(Settings::default_file_contents(), ""); } } diff --git a/src/simulation/investment.rs b/src/simulation/investment.rs index 1340c402a..282e4b056 100644 --- a/src/simulation/investment.rs +++ b/src/simulation/investment.rs @@ -861,7 +861,7 @@ mod tests { // Check all assets are removed when `only_candidates` is false opt_assets.push(candidate_asset.clone().into()); remove_assets_exceeding_agent_limits(&mut opt_assets, &limits, false); - assert!(opt_assets.is_empty()); + assert_eq!(opt_assets, []); } #[rstest] diff --git a/src/simulation/optimisation.rs b/src/simulation/optimisation.rs index 3b42e591e..62e91f37c 100644 --- a/src/simulation/optimisation.rs +++ b/src/simulation/optimisation.rs @@ -124,7 +124,7 @@ impl VariableMap { model: &Model, markets_to_allow_unmet_demand: &[(CommodityID, RegionID)], ) { - assert!(!markets_to_allow_unmet_demand.is_empty()); + assert_ne!(markets_to_allow_unmet_demand, []); // This line **must** come before we add more variables let start = problem.num_cols(); @@ -499,7 +499,7 @@ impl<'model, 'run> DispatchRun<'model, 'run> { self, markets_to_balance: &'run [(CommodityID, RegionID)], ) -> Self { - assert!(!markets_to_balance.is_empty()); + assert_ne!(markets_to_balance, []); Self { markets_to_balance, diff --git a/src/simulation/optimisation/constraints.rs b/src/simulation/optimisation/constraints.rs index fd233408a..d98bd8f5b 100644 --- a/src/simulation/optimisation/constraints.rs +++ b/src/simulation/optimisation/constraints.rs @@ -683,7 +683,10 @@ mod tests { #[test] fn groups_no_assets() { - assert!(group_dispatch_equivalent_assets(std::iter::empty()).is_empty()); + assert_eq!( + group_dispatch_equivalent_assets(std::iter::empty()), + [] as [std::vec::Vec<&AssetRef>; 0] + ); } #[rstest] diff --git a/tests/cli.rs b/tests/cli.rs index 28796b9ec..4a51ba3aa 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -100,7 +100,7 @@ fn check_example_list_command(#[case] patch: bool) { /// Test the `example info` command #[test] fn check_example_info_command() { - assert!(!get_muse2_stdout(&["example", "info", EXAMPLE_NAME]).is_empty()); + assert_ne!(get_muse2_stdout(&["example", "info", EXAMPLE_NAME]), ""); } #[test] From 2479c8d55335fd582034833763cfd9e07fdc2a11 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 11:06:16 +0000 Subject: [PATCH 3/3] [pre-commit.ci lite] apply automatic fixes --- Cargo.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ee6ad13cf..ad66378d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,21 +17,21 @@ csv = "1.4.0" log = "0.4.32" float-cmp = "0.10.0" itertools = "0.15.0" -serde = {version = "1.0.228", features = ["derive", "rc"]} +serde = { version = "1.0.228", features = ["derive", "rc"] } tempfile = "3.27.0" toml = "1.1.2" -fern = {version = "0.7.1", features = ["chrono", "colored"]} +fern = { version = "0.7.1", features = ["chrono", "colored"] } chrono = "0.4" -clap = {version = "4.6.1", features = ["cargo", "derive"]} +clap = { version = "4.6.1", features = ["cargo", "derive"] } include_dir = "0.7.4" highs = "2.4.0" indexmap = "2.14.0" human-panic = "2.0.8" clap-markdown = "0.1.5" platform-info = "2.1.0" -derive_more = {version = "2.1", features = ["add", "add_assign", "not", "deref", "display", "sum", "from_str", "from", "into"]} +derive_more = { version = "2.1", features = ["add", "add_assign", "not", "deref", "display", "sum", "from_str", "from", "into"] } petgraph = "0.8.3" -strum = {version = "0.28.0", features = ["derive"]} +strum = { version = "0.28.0", features = ["derive"] } documented = "0.10.0" dirs = "7.0.0" edit = "0.1.5" @@ -45,17 +45,17 @@ assert_cmd = "2.2.2" colored = "3.0.0" criterion = "0.8.2" ordered-float = "5.1.0" -rstest = {version = "0.27.0", default-features = false, features = ["crate-name"]} +rstest = { version = "0.27.0", default-features = false, features = ["crate-name"] } similar = "3.1.0" -yaml-rust2 = {version = "0.13.0", default-features = false} +yaml-rust2 = { version = "0.13.0", default-features = false } [build-dependencies] -built = {version = "0.8.1", features = ["chrono", "git2"]} +built = { version = "0.8.1", features = ["chrono", "git2"] } [lints.clippy] # Disallow lints from "all" and "pedantic" groups by default -all = {level = "deny", priority = -1} -pedantic = {level = "deny", priority = -1} +all = { level = "deny", priority = -1 } +pedantic = { level = "deny", priority = -1 } # Extra lints to disallow redundant_test_prefix = "deny" assertions_on_result_states = "deny"