1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 18:00:37 +02:00

service trait takes shared self reference (#247)

This commit is contained in:
fakeshadow
2021-01-22 19:06:22 -08:00
committed by GitHub
parent 874e5f2e50
commit 636cef8868
27 changed files with 225 additions and 219 deletions

View File

@ -58,11 +58,11 @@ where
type Error = ();
type Future = Ready<Result<(), ()>>;
fn poll_ready(&mut self, ctx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
fn poll_ready(&self, ctx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.service.poll_ready(ctx).map_err(|_| ())
}
fn call(&mut self, (guard, req): (Option<CounterGuard>, MioStream)) -> Self::Future {
fn call(&self, (guard, req): (Option<CounterGuard>, MioStream)) -> Self::Future {
ready(match FromStream::from_mio(req) {
Ok(stream) => {
let f = self.service.call(stream);