mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
fix clippy
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
7a8e8bd0ea
commit
cd1b196de4
1 changed files with 10 additions and 5 deletions
|
@ -407,6 +407,11 @@ impl FromJSValConvertibleRc for Promise {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The success steps of <https://webidl.spec.whatwg.org/#wait-for-all>
|
||||||
|
type WaitForAllSuccessSteps = Rc<dyn Fn(Vec<HandleValue>)>;
|
||||||
|
|
||||||
|
/// The failure steps of <https://webidl.spec.whatwg.org/#wait-for-all>
|
||||||
|
type WaitForAllFailureSteps = Rc<dyn Fn(HandleValue)>;
|
||||||
|
|
||||||
/// The fulfillment handler for the list of promises in
|
/// The fulfillment handler for the list of promises in
|
||||||
/// <https://webidl.spec.whatwg.org/#wait-for-all>.
|
/// <https://webidl.spec.whatwg.org/#wait-for-all>.
|
||||||
|
@ -416,7 +421,7 @@ struct WaitForAllFulfillmentHandler {
|
||||||
/// The steps to call when all promises are resolved.
|
/// The steps to call when all promises are resolved.
|
||||||
#[ignore_malloc_size_of = "Rc is hard"]
|
#[ignore_malloc_size_of = "Rc is hard"]
|
||||||
#[no_trace]
|
#[no_trace]
|
||||||
success_steps: Rc<dyn Fn(Vec<HandleValue>)>,
|
success_steps: WaitForAllSuccessSteps,
|
||||||
|
|
||||||
/// The results of the promises.
|
/// The results of the promises.
|
||||||
#[ignore_malloc_size_of = "Rc is hard"]
|
#[ignore_malloc_size_of = "Rc is hard"]
|
||||||
|
@ -442,7 +447,7 @@ impl Callback for WaitForAllFulfillmentHandler {
|
||||||
|
|
||||||
// Set fullfilledCount to fullfilledCount + 1.
|
// Set fullfilledCount to fullfilledCount + 1.
|
||||||
let mut fulfilled_count = self.fulfilled_count.borrow_mut();
|
let mut fulfilled_count = self.fulfilled_count.borrow_mut();
|
||||||
*fulfilled_count = *fulfilled_count + 1;
|
*fulfilled_count += 1;
|
||||||
|
|
||||||
*fulfilled_count == result.len()
|
*fulfilled_count == result.len()
|
||||||
};
|
};
|
||||||
|
@ -471,7 +476,7 @@ struct WaitForAllRejectionHandler {
|
||||||
/// The steps to call if any promise rejects.
|
/// The steps to call if any promise rejects.
|
||||||
#[ignore_malloc_size_of = "Rc is hard"]
|
#[ignore_malloc_size_of = "Rc is hard"]
|
||||||
#[no_trace]
|
#[no_trace]
|
||||||
failure_steps: Rc<dyn Fn(HandleValue)>,
|
failure_steps: WaitForAllFailureSteps,
|
||||||
|
|
||||||
/// Whether any promises have been rejected already.
|
/// Whether any promises have been rejected already.
|
||||||
rejected: Cell<bool>,
|
rejected: Cell<bool>,
|
||||||
|
@ -497,8 +502,8 @@ pub(crate) fn wait_for_all(
|
||||||
cx: SafeJSContext,
|
cx: SafeJSContext,
|
||||||
global: &GlobalScope,
|
global: &GlobalScope,
|
||||||
promises: Vec<Rc<Promise>>,
|
promises: Vec<Rc<Promise>>,
|
||||||
success_steps: Rc<dyn Fn(Vec<HandleValue>)>,
|
success_steps: WaitForAllSuccessSteps,
|
||||||
failure_steps: Rc<dyn Fn(HandleValue)>,
|
failure_steps: WaitForAllFailureSteps,
|
||||||
realm: InRealm,
|
realm: InRealm,
|
||||||
can_gc: CanGc,
|
can_gc: CanGc,
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue