Skip to content

Commit

Permalink
chore: Remove unused mutability
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Feb 13, 2025
1 parent fc940ce commit 2e26117
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tonic-web/src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ where
return Poll::Ready(Some(Ok(Frame::data(bytes))));
}

let mut this = self.as_mut().project();
let this = self.as_mut().project();

match ready!(this.inner.as_mut().poll_frame(cx)) {
match ready!(this.inner.poll_frame(cx)) {
Some(Ok(frame)) if frame.is_data() => this
.buf
.put(frame.into_data().unwrap_or_else(|_| unreachable!())),
Expand Down Expand Up @@ -217,9 +217,9 @@ where
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Bytes>, Status>>> {
let mut this = self.as_mut().project();
let this = self.as_mut().project();

match ready!(this.inner.as_mut().poll_frame(cx)) {
match ready!(this.inner.poll_frame(cx)) {
Some(Ok(frame)) if frame.is_data() => {
let mut data = frame.into_data().unwrap_or_else(|_| unreachable!());
let mut res = data.copy_to_bytes(data.remaining());
Expand Down
4 changes: 2 additions & 2 deletions tonic-web/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ where
type Output = Result<Response<Body>, E>;

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let mut this = self.project();
let this = self.project();

match this.case.as_mut().project() {
match this.case.project() {
CaseProj::GrpcWeb { future, accept } => {
let res = ready!(future.poll(cx))?;

Expand Down
2 changes: 1 addition & 1 deletion tonic/src/transport/server/io_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ where
where
IE: Into<crate::BoxError>,
{
match ready!(self.as_mut().project().inner.as_mut().poll_next(cx)) {
match ready!(self.as_mut().project().inner.poll_next(cx)) {
Some(Ok(io)) => Poll::Ready(Some(Ok(ServerIo::new_io(io)))),
Some(Err(e)) => match handle_tcp_accept_error(e) {
ControlFlow::Continue(()) => {
Expand Down

0 comments on commit 2e26117

Please sign in to comment.