Skip to content

chore: Remove unused mutability #2183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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