Skip to content

Commit a5ff216

Browse files
author
jizhuozhi.george
committed
Add Promise support for http callout
fix ci Signed-off-by: jizhuozhi.george <[email protected]>
1 parent 95f4d06 commit a5ff216

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/callout/promise.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ where
6666
match &*self.state.borrow() {
6767
PromiseState::Pending => {
6868
*self.then_callback.borrow_mut() = Some(Box::new(move |value| {
69-
let result = f(value.clone());
69+
let result = f(value);
7070
new_promise_clone.fulfill(result);
7171
}));
7272
let new_promise_for_catch = new_promise.clone();
@@ -135,7 +135,7 @@ where
135135
.catch(move |reason| {
136136
if !*rejected_clone_for_catch.borrow() {
137137
*rejected_clone_for_catch.borrow_mut() = true;
138-
next_promise_clone_for_catch.reject(reason.clone());
138+
next_promise_clone_for_catch.reject(reason);
139139
}
140140
});
141141
}
@@ -164,7 +164,7 @@ where
164164
})
165165
.catch(move |err| {
166166
if first_error_clone.borrow().is_none() {
167-
*first_error_clone.borrow_mut() = Some(err.clone());
167+
*first_error_clone.borrow_mut() = Some(err);
168168
}
169169

170170
*remaining_clone_for_catch.borrow_mut() -= 1;

0 commit comments

Comments
 (0)