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

feat: bring back TryFrom<Bytes> implementations #470

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tesaguri
Copy link
Contributor

@tesaguri tesaguri commented Mar 9, 2021

This is mostly a revert of commit 4ce5e6a, but this does not bring back the error variants suffixed with Bytes (db9b1b9).

This also replaces usages of the internal from_shared associated functions with try_from.

Closes #459.

@tesaguri
Copy link
Contributor Author

Rebased onto master and updated the commit to retain from_shared functions for now to make the diff concise and easy to review.

@tesaguri
Copy link
Contributor Author

Rebased onto master and replaced the internal from_shared constructors with try_from in a separate commit.

Also, I've added a commit to remove the from_maybe_shared constructors because Hyper is at the release candidate stage now and these constructors do not seem to be intended for v1.0.

@tesaguri tesaguri changed the title Bring back TryFrom<Bytes> implementations feat: bring back TryFrom<Bytes> implementations Aug 12, 2023
@tesaguri
Copy link
Contributor Author

@seanmonstar Sorry for the ping, but I believe this needs a decision, be it for or against, before the v1.0 release, since the PR contains a breaking change.

@seanmonstar
Copy link
Member

What's the breakage? The removal of from_maybe_shared? If done after 1.0, that could just be hidden and deprecated, it's not bad, right?

@tesaguri
Copy link
Contributor Author

All right. Then, I'll revert the removal of from_maybe_shared if/when the crate hits v1.0 before merging the PR.

This is mostly a revert of commit
4ce5e6a, but this does not bring back
the error variants suffixed with `Bytes`
(db9b1b9).

This also adds `HeaderValue::from_shared_unchecked` constructor, which
corresponds to the `from_maybe_shared_unchecked` constructor, and
replaces usage of the internal `from_shared` associated functions with
`try_from`.

Closes <hyperium#459>.
@tesaguri
Copy link
Contributor Author

Removed the commit to remove the from_maybe_shared constructors, and added a commit to deprecate and hide them from docs instead.

The CI failure is of the Nightly one and I haven't touched anything related to the Sealed trait, so it's not relevant to the patch, I guess?

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.

Expose Bytes to the public API again
2 participants