From 2e3f19af92bd0d3e8bf8a95ff4a4170602e28805 Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Mon, 17 Apr 2023 20:15:49 +0800 Subject: [PATCH] agent: fix clippy warnings caused by protobuf3 Fix warnings introduced by protobuf upgrade. Signed-off-by: Tim Zhang --- src/agent/src/mount.rs | 2 +- src/agent/src/rpc.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agent/src/mount.rs b/src/agent/src/mount.rs index 3f59d8f416..0eff266f24 100644 --- a/src/agent/src/mount.rs +++ b/src/agent/src/mount.rs @@ -211,7 +211,7 @@ async fn ephemeral_storage_handler( // By now we only support one option field: "fsGroup" which // isn't an valid mount option, thus we should remove it when // do mount. - if storage.options.len() > 0 { + if !storage.options.is_empty() { // ephemeral_storage didn't support mount options except fsGroup. let mut new_storage = storage.clone(); new_storage.options = Default::default(); diff --git a/src/agent/src/rpc.rs b/src/agent/src/rpc.rs index dbcb4bd131..4786539040 100644 --- a/src/agent/src/rpc.rs +++ b/src/agent/src/rpc.rs @@ -2034,7 +2034,7 @@ fn load_kernel_module(module: &protocols::agent::KernelModule) -> Result<()> { let mut args = vec!["-v".to_string(), module.name.clone()]; - if module.parameters.len() > 0 { + if !module.parameters.is_empty() { args.extend(module.parameters.to_vec()) }