1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-04-16 02:30:56 +02:00

docs/middleware: Add missing Clone derive on MyLayer ()

This commit is contained in:
Tobias Bieniek 2023-01-05 11:47:38 +01:00 committed by GitHub
parent 949da2b300
commit 2d8242b2c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,6 +229,7 @@ use futures::future::BoxFuture;
use tower::{Service, Layer};
use std::task::{Context, Poll};
#[derive(Clone)]
struct MyLayer;
impl<S> Layer<S> for MyLayer {
@ -258,7 +259,7 @@ where
self.inner.poll_ready(cx)
}
fn call(&mut self, mut request: Request<Body>) -> Self::Future {
fn call(&mut self, request: Request<Body>) -> Self::Future {
let future = self.inner.call(request);
Box::pin(async move {
let response: Response = future.await?;