From c5be78a03d2d0458229e4851a4c2e69e1d33118b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 2 Jan 2023 15:43:51 +0100 Subject: [PATCH] agent: Fix CCv0 specific unnecessary_lazy_evaluations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As we bumped the rust toolchain to 1.66.0, some new warnings have been raised due to unnecessary_lazy_evaluations. Let's fix them all here. For more info about the warnings, please, take a look at: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations Signed-off-by: Fabiano FidĂȘncio --- src/agent/src/image_rpc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agent/src/image_rpc.rs b/src/agent/src/image_rpc.rs index 1dcf98e49b..0a66987cb2 100644 --- a/src/agent/src/image_rpc.rs +++ b/src/agent/src/image_rpc.rs @@ -263,7 +263,8 @@ impl ImageService { if Path::new(SKOPEO_PATH).exists() { // Read the policy path from the agent config let config_policy_path = &AGENT_CONFIG.read().await.container_policy_path; - let policy_path = (!config_policy_path.is_empty()).then(|| config_policy_path.as_str()); + let policy_path = + (!config_policy_path.is_empty()).then_some(config_policy_path.as_str()); Self::pull_image_from_registry(image, &cid, source_creds, policy_path, aa_kbc_params)?; Self::unpack_image(&cid)?; } else {