From 55a6079db9fb5161cfb5a5fac0a7de115d798cff Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Tue, 12 Apr 2022 18:45:16 +0200 Subject: [PATCH] use pin_project instead of pin_project_lite --- .github/actions/cache/action.yaml | 4 +-- ddprof-exporter/src/connector/conn_stream.rs | 27 ++++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/actions/cache/action.yaml b/.github/actions/cache/action.yaml index b5ae639..625d672 100644 --- a/.github/actions/cache/action.yaml +++ b/.github/actions/cache/action.yaml @@ -1,5 +1,5 @@ -name: '[rust] Checkout and cache' -description: '[rust] Checkout cache' +name: '[rust] Cache' +description: '[rust] Cache' runs: using: composite diff --git a/ddprof-exporter/src/connector/conn_stream.rs b/ddprof-exporter/src/connector/conn_stream.rs index 579f010..9072a25 100644 --- a/ddprof-exporter/src/connector/conn_stream.rs +++ b/ddprof-exporter/src/connector/conn_stream.rs @@ -10,16 +10,23 @@ use futures::{future, Future, FutureExt, TryFutureExt}; use hyper_rustls::HttpsConnector; use pin_project::pin_project; -pin_project! { - #[derive(Debug)] - #[project = ConnStreamProj] - pub enum ConnStream { - Tcp{ #[pin] transport: tokio::net::TcpStream }, - Tls{ #[pin] transport: tokio_rustls::client::TlsStream}, - // Tokio doesn't handle unix sockets on windows - #[cfg(unix)] - Udp{ #[pin] transport: tokio::net::UnixStream }, - } +#[derive(Debug)] +#[pin_project(project=ConnStreamProj)] +pub enum ConnStream { + Tcp { + #[pin] + transport: tokio::net::TcpStream, + }, + Tls { + #[pin] + transport: tokio_rustls::client::TlsStream, + }, + // Tokio doesn't handle unix sockets on windows + #[cfg(unix)] + Udp { + #[pin] + transport: tokio::net::UnixStream, + }, } pub type ConnStreamError = Box;