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 <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2021-04-21 14:18:42 +10:00
parent 2377c0975c
commit e41cdb8b9f

View File

@ -273,12 +273,12 @@ fn get_string_value(param: &str) -> Result<String> {
}
// 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));
}