diff --git a/src/agent/src/config.rs b/src/agent/src/config.rs index 3788bb8bf7..8cf4e021b7 100644 --- a/src/agent/src/config.rs +++ b/src/agent/src/config.rs @@ -234,9 +234,7 @@ fn get_bool_value(param: &str) -> Result { // first try to parse as bool value v.parse::().or_else(|_err1| { // then try to parse as integer value - v.parse::() - .or_else(|_err2| Ok(0)) - .map(|v| !matches!(v, 0)) + v.parse::().or(Ok(0)).map(|v| !matches!(v, 0)) }) }