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:
@ -18,7 +18,7 @@ libc = "0.2"
|
||||
nix = "0.19.1"
|
||||
openssl = "0.10"
|
||||
percent-encoding = "2.1"
|
||||
pin-project = "1.0"
|
||||
pin-project-lite = "0.2"
|
||||
regex = "1.2"
|
||||
rustyline = "7"
|
||||
serde_json = "1.0"
|
||||
|
@ -3,7 +3,7 @@ use std::task::{Context, Poll};
|
||||
|
||||
use anyhow::Error;
|
||||
use futures::{ready, Stream};
|
||||
use pin_project::pin_project;
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
use pbs_datastore::data_blob::ChunkInfo;
|
||||
|
||||
@ -16,11 +16,12 @@ pub trait MergeKnownChunks: Sized {
|
||||
fn merge_known_chunks(self) -> MergeKnownChunksQueue<Self>;
|
||||
}
|
||||
|
||||
#[pin_project]
|
||||
pub struct MergeKnownChunksQueue<S> {
|
||||
#[pin]
|
||||
input: S,
|
||||
buffer: Option<MergedChunkInfo>,
|
||||
pin_project! {
|
||||
pub struct MergeKnownChunksQueue<S> {
|
||||
#[pin]
|
||||
input: S,
|
||||
buffer: Option<MergedChunkInfo>,
|
||||
}
|
||||
}
|
||||
|
||||
impl<S> MergeKnownChunks for S
|
||||
|
@ -8,7 +8,7 @@ use http::{Request, Response};
|
||||
use hyper::client::connect::{Connected, Connection};
|
||||
use hyper::client::Client;
|
||||
use hyper::Body;
|
||||
use pin_project::pin_project;
|
||||
use pin_project_lite::pin_project;
|
||||
use serde_json::Value;
|
||||
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadBuf};
|
||||
use tokio::net::UnixStream;
|
||||
@ -20,11 +20,12 @@ pub const DEFAULT_VSOCK_PORT: u16 = 807;
|
||||
#[derive(Clone)]
|
||||
struct VsockConnector;
|
||||
|
||||
#[pin_project]
|
||||
/// Wrapper around UnixStream so we can implement hyper::client::connect::Connection
|
||||
struct UnixConnection {
|
||||
#[pin]
|
||||
stream: UnixStream,
|
||||
pin_project! {
|
||||
/// Wrapper around UnixStream so we can implement hyper::client::connect::Connection
|
||||
struct UnixConnection {
|
||||
#[pin]
|
||||
stream: UnixStream,
|
||||
}
|
||||
}
|
||||
|
||||
impl tower_service::Service<Uri> for VsockConnector {
|
||||
|
Reference in New Issue
Block a user