Reduce size of response body types (#11)

Wrapping everything in `crate::body::Either` wasn't actually necessary
ans probably causes large body types. You can instead box the bodies in
the leaf services.
This commit is contained in:
David Pedersen
2021-06-13 10:10:37 +02:00
committed by GitHub
parent 7a051eb2d0
commit 59944c231f
6 changed files with 126 additions and 189 deletions
+2 -2
View File
@@ -479,10 +479,10 @@
//! let app = route(
//! // Any request to `/` goes to a service
//! "/",
//! service_fn(|_: Request<Body>| async {
//! service::any(service_fn(|_: Request<Body>| async {
//! let res = Response::new(Body::from("Hi from `GET /`"));
//! Ok::<_, Infallible>(res)
//! })
//! }))
//! ).route(
//! // GET `/static/Cargo.toml` goes to a service from tower-http
//! "/static/Cargo.toml",