diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index d56d01b69..1969eaba7 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -19,7 +19,6 @@ default = ["transport"] transport = [] [dependencies] -pin-project = "1" prost = "0.13" tokio = {version = "1.0", features = ["sync"]} tokio-stream = {version = "0.1", features = ["sync"]} diff --git a/tonic-health/src/server.rs b/tonic-health/src/server.rs index f27932b5a..33bc74b0b 100644 --- a/tonic-health/src/server.rs +++ b/tonic-health/src/server.rs @@ -3,7 +3,6 @@ use crate::pb::health_server::{Health, HealthServer}; use crate::pb::{HealthCheckRequest, HealthCheckResponse}; use crate::ServingStatus; -use pin_project::pin_project; use std::collections::HashMap; use std::fmt; use std::sync::Arc; @@ -150,9 +149,7 @@ impl Health for HealthService { } /// A watch stream for the health service. -#[pin_project] pub struct WatchStream { - #[pin] inner: tokio_stream::wrappers::WatchStream, } @@ -167,11 +164,10 @@ impl Stream for WatchStream { type Item = Result; fn poll_next( - self: std::pin::Pin<&mut Self>, + mut self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>, ) -> std::task::Poll> { - self.project() - .inner + std::pin::Pin::new(&mut self.inner) .poll_next(cx) .map(|opt| opt.map(|status| Ok(HealthCheckResponse::new(status)))) } diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 033ffb23c..620a0a54f 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -26,7 +26,6 @@ server = ["prost-types", "dep:tokio", "dep:tokio-stream"] default = ["server"] [dependencies] -pin-project = "1" prost = "0.13" prost-types = {version = "0.13", optional = true} tokio = { version = "1.0", features = ["sync", "rt"], optional = true } diff --git a/tonic-reflection/src/server/v1.rs b/tonic-reflection/src/server/v1.rs index 0b2b822d0..92153e0c4 100644 --- a/tonic-reflection/src/server/v1.rs +++ b/tonic-reflection/src/server/v1.rs @@ -1,6 +1,5 @@ use std::{fmt, sync::Arc}; -use pin_project::pin_project; use tokio::sync::mpsc; use tokio_stream::{wrappers::ReceiverStream, Stream, StreamExt}; use tonic::{Request, Response, Status, Streaming}; @@ -108,19 +107,16 @@ impl From for ReflectionService { } /// A response stream. -#[pin_project] -pub struct ServerReflectionInfoStream( - #[pin] ReceiverStream>, -); +pub struct ServerReflectionInfoStream(ReceiverStream>); impl Stream for ServerReflectionInfoStream { type Item = Result; fn poll_next( - self: std::pin::Pin<&mut Self>, + mut self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>, ) -> std::task::Poll> { - self.project().0.poll_next(cx) + std::pin::Pin::new(&mut self.0).poll_next(cx) } fn size_hint(&self) -> (usize, Option) { diff --git a/tonic-reflection/src/server/v1alpha.rs b/tonic-reflection/src/server/v1alpha.rs index a6ba7c609..9625f3cc6 100644 --- a/tonic-reflection/src/server/v1alpha.rs +++ b/tonic-reflection/src/server/v1alpha.rs @@ -1,6 +1,5 @@ use std::{fmt, sync::Arc}; -use pin_project::pin_project; use tokio::sync::mpsc; use tokio_stream::{wrappers::ReceiverStream, Stream, StreamExt}; use tonic::{Request, Response, Status, Streaming}; @@ -108,19 +107,16 @@ impl From for ReflectionService { } /// A response stream. -#[pin_project] -pub struct ServerReflectionInfoStream( - #[pin] ReceiverStream>, -); +pub struct ServerReflectionInfoStream(ReceiverStream>); impl Stream for ServerReflectionInfoStream { type Item = Result; fn poll_next( - self: std::pin::Pin<&mut Self>, + mut self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>, ) -> std::task::Poll> { - self.project().0.poll_next(cx) + std::pin::Pin::new(&mut self.0).poll_next(cx) } fn size_hint(&self) -> (usize, Option) {