From bff514628a4c186875b1b6c54cbf69e8b7c2bbc7 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sun, 5 Jan 2025 13:15:20 +0900 Subject: [PATCH] chore(channel): Remove redundant temporary variable (#2122) --- tonic/src/transport/channel/service/discover.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tonic/src/transport/channel/service/discover.rs b/tonic/src/transport/channel/service/discover.rs index 43f007158..838be3ced 100644 --- a/tonic/src/transport/channel/service/discover.rs +++ b/tonic/src/transport/channel/service/discover.rs @@ -32,15 +32,13 @@ impl Stream for DynamicServiceStream { type Item = Result, crate::BoxError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - let c = &mut self.changes; - match Pin::new(&mut *c).poll_recv(cx) { + match Pin::new(&mut self.changes).poll_recv(cx) { Poll::Pending | Poll::Ready(None) => Poll::Pending, Poll::Ready(Some(change)) => match change { Change::Insert(k, endpoint) => { let http = endpoint.http_connector(); let connection = Connection::lazy(endpoint.connector(http), endpoint); - let change = Ok(TowerChange::Insert(k, connection)); - Poll::Ready(Some(change)) + Poll::Ready(Some(Ok(TowerChange::Insert(k, connection)))) } Change::Remove(k) => Poll::Ready(Some(Ok(TowerChange::Remove(k)))), },