From 3a4dadc3c9e10a2ed2eac76377c1643bb71a29c5 Mon Sep 17 00:00:00 2001 From: Erikson Tung Date: Fri, 25 Aug 2023 12:12:54 -0700 Subject: [PATCH 1/3] chore: explicity set cargo feature resolver version to 2 This gets rid of a warning that comes with rust 1.72.0. This does not impact any of our existing crates since they're all on edition 2021. See https://github.com/rust-lang/cargo/issues/10112 --- sources/Cargo.toml | 1 + tools/Cargo.toml | 1 + variants/Cargo.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 9b34dabd62a..77e2eefd821 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "api/apiserver", "api/apiclient", diff --git a/tools/Cargo.toml b/tools/Cargo.toml index 03fb9b38b5e..223aaf879ed 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "infrasys", "buildsys", diff --git a/variants/Cargo.toml b/variants/Cargo.toml index 197e75c04e3..fb313be9106 100644 --- a/variants/Cargo.toml +++ b/variants/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "aws-dev", "aws-ecs-1", From 7b8a0abef42a76058e81c426a8ac133fdb370e3f Mon Sep 17 00:00:00 2001 From: Erikson Tung Date: Fri, 25 Aug 2023 12:22:19 -0700 Subject: [PATCH 2/3] tools: fix 1.72.0 clippy warnings --- tools/buildsys/src/gomod.rs | 4 ++-- tools/pubsys/src/aws/promote_ssm/mod.rs | 2 +- tools/pubsys/src/aws/publish_ami/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/buildsys/src/gomod.rs b/tools/buildsys/src/gomod.rs index de4b89c8484..6a1dabc0a35 100644 --- a/tools/buildsys/src/gomod.rs +++ b/tools/buildsys/src/gomod.rs @@ -48,7 +48,7 @@ const GO_MOD_DOCKER_SCRIPT_NAME: &str = "docker-go-script.sh"; // buildsys is executed from the context of many different package directories, // managing a temporary file via this Rust module prevents having to acquire the // path of some static script file on the host system. -const GO_MOD_SCRIPT_TMPL: &str = r###"#!/bin/bash +const GO_MOD_SCRIPT_TMPL: &str = r#".#!/bin/bash set -e @@ -68,7 +68,7 @@ popd tar czf __OUTPUT__ "${targetdir}"/vendor rm -rf "${targetdir}" touch -r __LOCAL_FILE_NAME__ __OUTPUT__ -"###; +"#; impl GoMod { pub(crate) fn vendor( diff --git a/tools/pubsys/src/aws/promote_ssm/mod.rs b/tools/pubsys/src/aws/promote_ssm/mod.rs index 28b6b292bdb..21f4ca1d413 100644 --- a/tools/pubsys/src/aws/promote_ssm/mod.rs +++ b/tools/pubsys/src/aws/promote_ssm/mod.rs @@ -281,7 +281,7 @@ fn merge_parameters( source_parameters .into_iter() // Process the `set_parameters` second so that they overwrite existing values. - .chain(set_parameters.clone().into_iter()) + .chain(set_parameters.clone()) .for_each(|(ssm_key, ssm_value)| { combined_parameters // The `entry()` API demands that we clone diff --git a/tools/pubsys/src/aws/publish_ami/mod.rs b/tools/pubsys/src/aws/publish_ami/mod.rs index a80fb505124..578bdee4898 100644 --- a/tools/pubsys/src/aws/publish_ami/mod.rs +++ b/tools/pubsys/src/aws/publish_ami/mod.rs @@ -514,7 +514,7 @@ pub(crate) async fn modify_regional_images( info!("Modified permissions of image {} in {}", image_id, region); // Set the `public` and `launch_permissions` fields for the Image object - let mut image = images.get_mut(&Region::new(region.clone())).ok_or( + let image = images.get_mut(&Region::new(region.clone())).ok_or( error::Error::MissingRegion { region: region.clone(), }, From 84d991484982c9004945226eaa1c516c15f1aae0 Mon Sep 17 00:00:00 2001 From: Erikson Tung Date: Fri, 25 Aug 2023 12:28:42 -0700 Subject: [PATCH 3/3] sources: fix 1.72.0 clippy warnings --- sources/api/storewolf/src/main.rs | 3 +-- sources/models/scalar-derive/src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sources/api/storewolf/src/main.rs b/sources/api/storewolf/src/main.rs index 58b1de9383f..17ab3ff7393 100644 --- a/sources/api/storewolf/src/main.rs +++ b/sources/api/storewolf/src/main.rs @@ -170,8 +170,7 @@ fn parse_metadata_toml(md_toml_val: toml::Value) -> Result> // Start at the root of the tree. let mut to_process = vec![(Vec::new(), md_toml_val)]; - while !to_process.is_empty() { - let (mut path, toml_value) = to_process.pop().unwrap(); + while let Some((mut path, toml_value)) = to_process.pop() { trace!("Current metadata table path: {:#?}", &path); match toml_value { diff --git a/sources/models/scalar-derive/src/lib.rs b/sources/models/scalar-derive/src/lib.rs index 501ae10f7d5..cbfbef37c10 100644 --- a/sources/models/scalar-derive/src/lib.rs +++ b/sources/models/scalar-derive/src/lib.rs @@ -437,7 +437,7 @@ impl StructInfo { } ); - stream.append_all(impls.into_iter()); + stream.append_all(impls); // Generate code that is only applicable if the inner type can be treated like a String. if self.as_ref_str { @@ -481,7 +481,7 @@ impl StructInfo { } } ); - stream.append_all(code.into_iter()); + stream.append_all(code); } // If the inner type is String, then we already have this implemented. If not, we can add @@ -494,7 +494,7 @@ impl StructInfo { } } ); - stream.append_all(code.into_iter()); + stream.append_all(code); } } } @@ -594,7 +594,7 @@ fn write_string_impls_for_enum(name: &str, ast: &mut TokenStream2) { } ); - ast.append_all(impls.into_iter()); + ast.append_all(impls); } /// Make sure all variants of the enum are empty of data. Otherwise we can't represent this enum