mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-15 00:00:20 +02:00
Previously, when routing between one or two requests the two body types would be merged by boxing them. This isn't ideal since it introduces a layer indirection for each route. We can't require the services to be routed between as not all services use the same body type. This changes that so it instead uses an `Either` enum that implements `http_body::Body` if each variant does. Will reduce the overall allocations and hopefully the compiler can optimize things if both variants are the same.