From db4dc1936b7eb1a49bd6419732c2230000827331 Mon Sep 17 00:00:00 2001 From: shaobo-he-aws <130499339+shaobo-he-aws@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:28:25 -0700 Subject: [PATCH] Fix slow units in `convert-policy-json-to-cedar` (#419) Signed-off-by: Shaobo He --- cedar-drt/fuzz/fuzz_targets/convert-policy-json-to-cedar.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cedar-drt/fuzz/fuzz_targets/convert-policy-json-to-cedar.rs b/cedar-drt/fuzz/fuzz_targets/convert-policy-json-to-cedar.rs index 458dff0e9..6c4ccdd17 100644 --- a/cedar-drt/fuzz/fuzz_targets/convert-policy-json-to-cedar.rs +++ b/cedar-drt/fuzz/fuzz_targets/convert-policy-json-to-cedar.rs @@ -30,7 +30,8 @@ enum ESTParseError { } fuzz_target!(|est_json_str: String| { - if let Ok(ast_from_est) = serde_json::from_str::(&est_json_str) + if let Ok(ast_from_est) = serde_json::from_str::(&est_json_str) + .and_then(|val| serde_json::from_value::(val)) .map_err(ESTParseError::from) .and_then(|est| { est.try_into_ast_template(Some(PolicyID::from_string("policy0")))