agent: Fix CCv0 specific unnecessary_lazy_evaluations

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 <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-01-02 15:43:51 +01:00
parent 60a8a5bf4a
commit c5be78a03d

View File

@ -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 {