mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
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:
parent
2377c0975c
commit
e41cdb8b9f
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user