mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 01:13:02 +00:00 
			
		
		
		
	agent: Simplify .or_else() to .or()
get_bool_value() in src/agent/src/config.rs includes a Result::or_else() call with a trivial closure which can be replaced by a Result::or. This removes a clippy warning. fixes #1201 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
		| @@ -234,9 +234,7 @@ fn get_bool_value(param: &str) -> Result<bool> { | |||||||
|     // first try to parse as bool value |     // first try to parse as bool value | ||||||
|     v.parse::<bool>().or_else(|_err1| { |     v.parse::<bool>().or_else(|_err1| { | ||||||
|         // then try to parse as integer value |         // then try to parse as integer value | ||||||
|         v.parse::<u64>() |         v.parse::<u64>().or(Ok(0)).map(|v| !matches!(v, 0)) | ||||||
|             .or_else(|_err2| Ok(0)) |  | ||||||
|             .map(|v| !matches!(v, 0)) |  | ||||||
|     }) |     }) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user