Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Sep 9, 2024
1 parent 661969e commit ff273be
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/engine/src/try_into_js_result_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ where
T: TryIntoJsResult,
{
fn try_into_js_result(self, cx: &mut Context) -> JsResult<JsValue> {
Ok(JsArray::from_iter(
self.into_iter().map(|value| value.try_into_js_result(cx)),
cx,
)
.into())
let array = JsArray::new(cx);
// We have to manually enumerate because we cannot return a Result from a map monad.
for value in self {
array.push(value.try_into_js_result(cx)?, cx)?;
}
Ok(array.into())
}
}

Expand Down

0 comments on commit ff273be

Please sign in to comment.