cargo: switch from proc-macro pin-project to declarative pin-project-lite
In our simple use cases they both should generate the same code, see [0] for notable differences. While we cannot drop proc-macro due to that switch, all of our dependencies that use pinning already use pin-project-lite, so this allows us to drop a whole crate in general while not loosing anything. [0]: https://github.com/taiki-e/pin-project-lite#pin-project-vs-pin-project-lite Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
a294588409
commit
71549afa3f
|
@ -68,8 +68,6 @@ openssl = "0.10"
|
||||||
pam = "0.7"
|
pam = "0.7"
|
||||||
pam-sys = "0.5"
|
pam-sys = "0.5"
|
||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
pin-utils = "0.1.0"
|
|
||||||
pin-project = "1.0"
|
|
||||||
regex = "1.2"
|
regex = "1.2"
|
||||||
rustyline = "7"
|
rustyline = "7"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
|
@ -37,8 +37,7 @@ Build-Depends: debhelper (>= 12),
|
||||||
librust-pam-sys-0.5+default-dev,
|
librust-pam-sys-0.5+default-dev,
|
||||||
librust-pathpatterns-0.1+default-dev (>= 0.1.2-~~),
|
librust-pathpatterns-0.1+default-dev (>= 0.1.2-~~),
|
||||||
librust-percent-encoding-2+default-dev (>= 2.1-~~),
|
librust-percent-encoding-2+default-dev (>= 2.1-~~),
|
||||||
librust-pin-project-1+default-dev,
|
librust-pin-project-lite-0.2+default-dev,
|
||||||
librust-pin-utils-0.1+default-dev,
|
|
||||||
librust-proxmox-0.13+api-macro-dev,
|
librust-proxmox-0.13+api-macro-dev,
|
||||||
librust-proxmox-0.13+cli-dev,
|
librust-proxmox-0.13+cli-dev,
|
||||||
librust-proxmox-0.13+default-dev,
|
librust-proxmox-0.13+default-dev,
|
||||||
|
|
|
@ -18,7 +18,7 @@ libc = "0.2"
|
||||||
nix = "0.19.1"
|
nix = "0.19.1"
|
||||||
openssl = "0.10"
|
openssl = "0.10"
|
||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
pin-project = "1.0"
|
pin-project-lite = "0.2"
|
||||||
regex = "1.2"
|
regex = "1.2"
|
||||||
rustyline = "7"
|
rustyline = "7"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::task::{Context, Poll};
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use futures::{ready, Stream};
|
use futures::{ready, Stream};
|
||||||
use pin_project::pin_project;
|
use pin_project_lite::pin_project;
|
||||||
|
|
||||||
use pbs_datastore::data_blob::ChunkInfo;
|
use pbs_datastore::data_blob::ChunkInfo;
|
||||||
|
|
||||||
|
@ -16,12 +16,13 @@ pub trait MergeKnownChunks: Sized {
|
||||||
fn merge_known_chunks(self) -> MergeKnownChunksQueue<Self>;
|
fn merge_known_chunks(self) -> MergeKnownChunksQueue<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[pin_project]
|
pin_project! {
|
||||||
pub struct MergeKnownChunksQueue<S> {
|
pub struct MergeKnownChunksQueue<S> {
|
||||||
#[pin]
|
#[pin]
|
||||||
input: S,
|
input: S,
|
||||||
buffer: Option<MergedChunkInfo>,
|
buffer: Option<MergedChunkInfo>,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<S> MergeKnownChunks for S
|
impl<S> MergeKnownChunks for S
|
||||||
where
|
where
|
||||||
|
|
|
@ -8,7 +8,7 @@ use http::{Request, Response};
|
||||||
use hyper::client::connect::{Connected, Connection};
|
use hyper::client::connect::{Connected, Connection};
|
||||||
use hyper::client::Client;
|
use hyper::client::Client;
|
||||||
use hyper::Body;
|
use hyper::Body;
|
||||||
use pin_project::pin_project;
|
use pin_project_lite::pin_project;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadBuf};
|
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadBuf};
|
||||||
use tokio::net::UnixStream;
|
use tokio::net::UnixStream;
|
||||||
|
@ -20,12 +20,13 @@ pub const DEFAULT_VSOCK_PORT: u16 = 807;
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct VsockConnector;
|
struct VsockConnector;
|
||||||
|
|
||||||
#[pin_project]
|
pin_project! {
|
||||||
/// Wrapper around UnixStream so we can implement hyper::client::connect::Connection
|
/// Wrapper around UnixStream so we can implement hyper::client::connect::Connection
|
||||||
struct UnixConnection {
|
struct UnixConnection {
|
||||||
#[pin]
|
#[pin]
|
||||||
stream: UnixStream,
|
stream: UnixStream,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl tower_service::Service<Uri> for VsockConnector {
|
impl tower_service::Service<Uri> for VsockConnector {
|
||||||
type Response = UnixConnection;
|
type Response = UnixConnection;
|
||||||
|
|
Loading…
Reference in New Issue