refactor(lib): Switch from pin-project to pin-project-lite

This commit is contained in:
Jonas Platte
2021-01-12 00:12:21 +01:00
committed by Sean McArthur
parent 9dff00425d
commit 43412a950f
14 changed files with 343 additions and 262 deletions

View File

@@ -1,6 +1,6 @@
use std::mem;
use pin_project::pin_project;
use pin_project_lite::pin_project;
use tokio::sync::watch;
use super::{task, Future, Pin, Poll};
@@ -21,14 +21,15 @@ pub(crate) struct Watch {
rx: watch::Receiver<()>,
}
#[allow(missing_debug_implementations)]
#[pin_project]
pub struct Watching<F, FN> {
#[pin]
future: F,
state: State<FN>,
watch: Pin<Box<dyn Future<Output = ()> + Send + Sync>>,
_rx: watch::Receiver<()>,
pin_project! {
#[allow(missing_debug_implementations)]
pub struct Watching<F, FN> {
#[pin]
future: F,
state: State<FN>,
watch: Pin<Box<dyn Future<Output = ()> + Send + Sync>>,
_rx: watch::Receiver<()>,
}
}
enum State<F> {