Skip to content

Commit

Permalink
Add Promise support for http callout
Browse files Browse the repository at this point in the history
fix ci

Signed-off-by: jizhuozhi.george <[email protected]>
  • Loading branch information
jizhuozhi committed Oct 14, 2024
1 parent 95f4d06 commit a5ff216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/callout/promise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ where
match &*self.state.borrow() {
PromiseState::Pending => {
*self.then_callback.borrow_mut() = Some(Box::new(move |value| {
let result = f(value.clone());
let result = f(value);
new_promise_clone.fulfill(result);
}));
let new_promise_for_catch = new_promise.clone();
Expand Down Expand Up @@ -135,7 +135,7 @@ where
.catch(move |reason| {
if !*rejected_clone_for_catch.borrow() {
*rejected_clone_for_catch.borrow_mut() = true;
next_promise_clone_for_catch.reject(reason.clone());
next_promise_clone_for_catch.reject(reason);
}
});
}
Expand Down Expand Up @@ -164,7 +164,7 @@ where
})
.catch(move |err| {
if first_error_clone.borrow().is_none() {
*first_error_clone.borrow_mut() = Some(err.clone());
*first_error_clone.borrow_mut() = Some(err);
}

*remaining_clone_for_catch.borrow_mut() -= 1;
Expand Down

0 comments on commit a5ff216

Please sign in to comment.