refactor(lib): Switch from pin-project to pin-project-lite (#2566)
Note the practical affects of this change: - Dependency count with --features full dropped from 65 to 55. - Time to compile after a clean dropped from 48s to 35s (on a pretty underpowered VM). Closes #2388
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user