Remove unnecessary generic parameter from Set{Request,Response}HeaderLayer #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently,
SetRequestHeaderLayer
andSetResponseHeaderLayer
have to have a turbofish supplied when used with a plainHeaderValue
(orOption<HeaderValue>
) instead of a closure, which is annoying.Solution
Adjust the generics to make things work out :)
Unfortunately, this conflicts with #147 and as such error messages from closures with wrong parameter types will continue to be reported rather late somewhere in the usage of these layers rather than at the construction site. However, I consider this change to be more valuable than #147.
This is a breaking change because it changes the number of generic parameters and previous
::<_, Body>
turbofish usage will thus become invalid.Properly fixes #127