From e41cdb8b9f792626b7a6aaaea521fbc9d865f994 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 21 Apr 2021 14:18:42 +1000 Subject: [PATCH] agent: Use str::is_empty() method in config::get_string_value() An explicit check against "" is a bit less clear and makes clippy complain. fixes #1611 Signed-off-by: David Gibson --- src/agent/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agent/src/config.rs b/src/agent/src/config.rs index 3d6e168e62..bc415cdc15 100644 --- a/src/agent/src/config.rs +++ b/src/agent/src/config.rs @@ -273,12 +273,12 @@ fn get_string_value(param: &str) -> Result { } // We need name (but the value can be blank) - if fields[0] == "" { + if fields[0].is_empty() { return Err(anyhow!(ERR_INVALID_GET_VALUE_NO_NAME)); } let value = fields[1..].join("="); - if value == "" { + if value.is_empty() { return Err(anyhow!(ERR_INVALID_GET_VALUE_NO_VALUE)); }