Skip to content
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

Improve set header #143

Merged
merged 4 commits into from
Sep 18, 2021
Merged

Improve set header #143

merged 4 commits into from
Sep 18, 2021

Conversation

jplatte
Copy link
Collaborator

@jplatte jplatte commented Sep 10, 2021

Motivation

Makes the code more maintainable, and docs neater (providing rustdoc with a clear tagline / rest of the docs for overview pages).

Solution

Refactor stuff.

Other

I didn't rename T in Set{Request,Response}HeaderLayer to ReqBody / ResBody here, but I think that might also make sense.

All of this refactoring happened in an attempt to fix #127, which I still believe is possible but I've spent enough time on this for now.

@jplatte
Copy link
Collaborator Author

jplatte commented Sep 10, 2021

The last commit is a breaking change due to adding / strengthening trait bounds. Other people could have replicated the strange previous bound (and lack of Clone bound) in their own generic code, which would then break with this change.

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

What do you think about leaving the bounds as they were and changing them for 0.2?

@jplatte
Copy link
Collaborator Author

jplatte commented Sep 18, 2021

Sure. Do you want to merge the rest of this PR on the command line or should I split the PR?

@davidpdrsn
Copy link
Member

I would appreciate it if you would split it. Then I can merge directly from GH.

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@davidpdrsn davidpdrsn merged commit 41bcf9d into tower-rs:master Sep 18, 2021
@jplatte jplatte deleted the improve-set-header branch September 18, 2021 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SetResponseHeaderLayer et al are hard to use with literal HeaderValues
2 participants