From a156752f2771abe1fe33a19027df0d74bd8abcb8 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:42:20 +0100 Subject: [PATCH] Fix lint errors with Rust 1.73 and 1.74 To unblock #217. Fixed using `cargo clippy --all-targets --fix`. `warning: matching over () is more explicit` https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns `warning: unnecessary hashes around raw string literal` https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes As seen in: https://github.com/heroku/buildpacks-ruby/actions/runs/6456039106/job/17524710712?pr=217 --- buildpacks/ruby/src/gem_list.rs | 4 ++-- buildpacks/ruby/src/layers/bundle_install_layer.rs | 4 ++-- buildpacks/ruby/src/layers/metrics_agent_install.rs | 2 +- buildpacks/ruby/src/layers/ruby_install_layer.rs | 2 +- buildpacks/ruby/src/main.rs | 6 +++--- buildpacks/ruby/src/rake_task_detect.rs | 4 ++-- buildpacks/ruby/tests/integration_test.rs | 4 ++-- commons/src/gemfile_lock.rs | 8 ++++---- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/buildpacks/ruby/src/gem_list.rs b/buildpacks/ruby/src/gem_list.rs index 47b33b1f..ee65a42c 100644 --- a/buildpacks/ruby/src/gem_list.rs +++ b/buildpacks/ruby/src/gem_list.rs @@ -123,7 +123,7 @@ mod tests { #[test] fn test_parsing_gem_list() { let gem_list = GemList::from_str( - r#" + r" Gems included by the bundle: * actioncable (6.1.4.1) * actionmailbox (6.1.4.1) @@ -140,7 +140,7 @@ Gems included by the bundle: * ast (2.4.2) * railties (6.1.4.1) Use `bundle info` to print more detailed information about a gem - "#, + ", ) .unwrap(); diff --git a/buildpacks/ruby/src/layers/bundle_install_layer.rs b/buildpacks/ruby/src/layers/bundle_install_layer.rs index 60de1eb6..481bc718 100644 --- a/buildpacks/ruby/src/layers/bundle_install_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_install_layer.rs @@ -412,7 +412,7 @@ mod test { let env = layer_env.apply(Scope::All, &Env::new()); let actual = commons::display::env_to_sorted_string(&env); - let expected = r#" + let expected = r" BUNDLE_BIN=layer_path/bin BUNDLE_CLEAN=1 BUNDLE_DEPLOYMENT=1 @@ -420,7 +420,7 @@ BUNDLE_GEMFILE=app_path/Gemfile BUNDLE_PATH=layer_path BUNDLE_WITHOUT=development:test GEM_PATH=layer_path - "#; + "; assert_eq!(expected.trim(), actual.trim()); } diff --git a/buildpacks/ruby/src/layers/metrics_agent_install.rs b/buildpacks/ruby/src/layers/metrics_agent_install.rs index af0361c7..0e3dc1a1 100644 --- a/buildpacks/ruby/src/layers/metrics_agent_install.rs +++ b/buildpacks/ruby/src/layers/metrics_agent_install.rs @@ -202,7 +202,7 @@ fn write_execd_script( } fn install_agentmon(dir: &Path) -> Result { - let agentmon = download_untar(DOWNLOAD_URL, dir).map(|_| dir.join("agentmon"))?; + let agentmon = download_untar(DOWNLOAD_URL, dir).map(|()| dir.join("agentmon"))?; chmod_plus_x(&agentmon).map_err(MetricsAgentInstallError::PermissionError)?; Ok(agentmon) diff --git a/buildpacks/ruby/src/layers/ruby_install_layer.rs b/buildpacks/ruby/src/layers/ruby_install_layer.rs index c954c83c..5d454478 100644 --- a/buildpacks/ruby/src/layers/ruby_install_layer.rs +++ b/buildpacks/ruby/src/layers/ruby_install_layer.rs @@ -135,7 +135,7 @@ fn download_url(stack: &StackId, version: impl std::fmt::Display) -> Result