This commit is contained in:
royvardhan
2025-02-05 20:54:30 +05:30
parent c4f9fd0fa6
commit a3cf443056

View File

@@ -61,12 +61,11 @@ pub fn parse_solution(input: Value) -> Result<Solution, Box<dyn std::error::Erro
native_action: obj native_action: obj
.get("native_action") .get("native_action")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.map(|s| match s.to_lowercase().as_str() { .and_then(|s| match s.to_lowercase().as_str() {
"wrap" => Some(NativeAction::Wrap), "wrap" => Some(NativeAction::Wrap),
"unwrap" => Some(NativeAction::Unwrap), "unwrap" => Some(NativeAction::Unwrap),
_ => None, // Default to None _ => None, // Default to None
}) }),
.flatten(),
direct_execution: obj direct_execution: obj
.get("direct_execution") .get("direct_execution")
.and_then(|v| v.as_bool()) .and_then(|v| v.as_bool())