mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-25 10:43:15 +00:00
Merge pull request #1202 from dgibson/bug1201
agent: Simplify .or_else() to .or()
This commit is contained in:
@@ -234,9 +234,7 @@ fn get_bool_value(param: &str) -> Result<bool> {
|
||||
// first try to parse as bool value
|
||||
v.parse::<bool>().or_else(|_err1| {
|
||||
// then try to parse as integer value
|
||||
v.parse::<u64>()
|
||||
.or_else(|_err2| Ok(0))
|
||||
.map(|v| !matches!(v, 0))
|
||||
v.parse::<u64>().or(Ok(0)).map(|v| !matches!(v, 0))
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user