misc(backend): fix reborrowing Pin<&mut T> as described in the doc https://doc.rust-lang.org/stable/std/pin/struct.Pin.html#method.as_mut

This commit is contained in:
Morgan Funtowicz 2024-12-05 16:31:19 +01:00
parent 049f4acd5b
commit f0cd4742c2

View File

@ -113,7 +113,8 @@ fn executor_status_looper(
} }
if backend.num_tokens_ready() > 0 { if backend.num_tokens_ready() > 0 {
match backend.pin_mut().pull_tokens() { let mut backend = backend.pin_mut();
match backend.as_mut().pull_tokens() {
Ok(responses) => { Ok(responses) => {
// Iterate through all the decoded token // Iterate through all the decoded token
for step in responses.deref() { for step in responses.deref() {
@ -139,7 +140,7 @@ fn executor_status_looper(
if let Err(_) = ctx.streamer.send(response) { if let Err(_) = ctx.streamer.send(response) {
// Client has dropped, remove from tracked requests // Client has dropped, remove from tracked requests
debug!("Client dropped - removing request {} from tracked requests", step.request_id); debug!("Client dropped - removing request {} from tracked requests", step.request_id);
backend.pin_mut().cancel(step.request_id); backend.as_mut().cancel(step.request_id);
let _ = in_flights.remove(&step.request_id); let _ = in_flights.remove(&step.request_id);
} }
} else { } else {