From b4de302cb2ffca832bacdba744ceb3252d21b346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 28 Jan 2025 08:19:03 +0100 Subject: [PATCH] genpolicy: Adjust to build with rust 1.80.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` error: field `image` is never read --> src/registry.rs:35:9 | 34 | pub struct Container { | --------- field in this struct 35 | pub image: String, | ^^^^^ | = note: `Container` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis = note: `-D dead-code` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(dead_code)]` error: field `use_cache` is never read --> src/utils.rs:106:9 | 105 | pub struct Config { | ------ field in this struct 106 | pub use_cache: bool, | ^^^^^^^^^ | = note: `Config` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis error: could not compile `genpolicy` (bin "genpolicy") due to 2 previous errors ``` Signed-off-by: Fabiano FidĂȘncio Signed-off-by: stevenhorsman --- src/tools/genpolicy/src/registry.rs | 1 + src/tools/genpolicy/src/utils.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tools/genpolicy/src/registry.rs b/src/tools/genpolicy/src/registry.rs index 7aa0e66a9c..eb87872854 100644 --- a/src/tools/genpolicy/src/registry.rs +++ b/src/tools/genpolicy/src/registry.rs @@ -32,6 +32,7 @@ use tokio::io::AsyncWriteExt; /// Container image properties obtained from an OCI repository. #[derive(Clone, Debug, Default)] pub struct Container { + #[allow(dead_code)] pub image: String, pub config_layer: DockerConfigLayer, pub image_layers: Vec, diff --git a/src/tools/genpolicy/src/utils.rs b/src/tools/genpolicy/src/utils.rs index f3a53b49dc..002eafaf17 100644 --- a/src/tools/genpolicy/src/utils.rs +++ b/src/tools/genpolicy/src/utils.rs @@ -103,6 +103,7 @@ struct CommandLineOptions { /// Application configuration, derived from on command line parameters. #[derive(Clone, Debug)] pub struct Config { + #[allow(dead_code)] pub use_cache: bool, pub insecure_registries: Vec, pub runtime_class_names: Vec,