-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequestBodyLimitLayer
when applied via ServiceBuilder
won't compile in v0.7
#2492
Comments
I think I figured it out. I'm using |
That can’t be it. Tower doesn’t depend on http at all. |
In that case, does this look like a bug? If so, I’ll reopen. |
I've been looking into this issue a little more and do see an |
No that’s unrelated since it’s a dev dependency. |
Bug Report
Version
Platform
Crates
Description
With
ServiceBuilder
I was applying multiple middleware, the first of which wasRequestBodyLimitLayer
and everything compiled in v0.6 (when theB
type parameter was still available). With Axum now having its own body type in v0.7, the following example no longer compiles:I noticed in the "Fewer generics" section from the v0.7 announcement blog post that
ServiceBuilder
wasn't being used and sure enough things will compile ifRequestBodyLimitLayer
is moved to its own layer (like in the blog post):To keep
RequestBodyLimitLayer
a part ofServiceBuilder
, things will also compile if it is moved out of the first position (but I will eventually need it to be first):In #1110 (and mentioned in the blog post) the solution back in v0.6 was to extract
Request<http_body::Limited<Body>>
instead ofRequest<Body>
in subsequent middleware. But with the body type parameter being removed from v0.7, I'm not sure how to satisfy the trait bound in this situation (other than avoid usingRequestBodyLimitLayer
withServiceBuilder
).The text was updated successfully, but these errors were encountered: