diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-20 10:37:09 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-20 10:37:09 +0200 |
commit | 6c9fb5ae7a4eb6cff38de3bb6446af304a32bc8a (patch) | |
tree | 63a8bd729171e5886340fe89774f2287bd11cb5b /components/script/dom/bindings | |
parent | 52527d6f9dfaae13458059243d975f5336bdead4 (diff) | |
download | servo-6c9fb5ae7a4eb6cff38de3bb6446af304a32bc8a.tar.gz servo-6c9fb5ae7a4eb6cff38de3bb6446af304a32bc8a.zip |
Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
Diffstat (limited to 'components/script/dom/bindings')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index 1f1f9c52722..45d7d721307 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -40,7 +40,7 @@ use std::marker::PhantomData; use std::os; use std::rc::Rc; use std::sync::{Arc, Weak}; -use task::TaskBox; +use task::TaskOnce; #[allow(missing_docs)] // FIXME @@ -122,7 +122,7 @@ impl TrustedPromise { /// A task which will reject the promise. #[allow(unrooted_must_root)] - pub fn reject_task(self, error: Error) -> impl TaskBox { + pub fn reject_task(self, error: Error) -> impl TaskOnce { let this = self; task!(reject_promise: move || { debug!("Rejecting promise."); @@ -135,7 +135,7 @@ impl TrustedPromise { /// A task which will resolve the promise. #[allow(unrooted_must_root)] - pub fn resolve_task<T>(self, value: T) -> impl TaskBox + pub fn resolve_task<T>(self, value: T) -> impl TaskOnce where T: ToJSValConvertible + Send, { |