-
Notifications
You must be signed in to change notification settings - Fork 114
Rename AsBytes
to IntoBytes
#695
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
compatibility-breaking
Changes that are (likely to be) breaking
Comments
This was referenced Dec 8, 2023
joshlf
added a commit
that referenced
this issue
Dec 8, 2023
Previously, `T: AsBytes` indicated that `&T -> &[u8]` was a valid transformation. As of #682, `T: AsBytes` only indicates that `T -> [u8]` is a valid transformation. This slightly changes the meaning of `AsBytes` and makes `ToBytes` a more appropriate name since it only permits value rather than reference transmutations. This also brings the pair of `FromBytes` and `ToBytes` in line with the standard library `From` and `Into` traits from a naming perspective. Closes #695
joshlf
added a commit
that referenced
this issue
Dec 11, 2023
Previously, `T: AsBytes` indicated that `&T -> &[u8]` was a valid transformation. As of #682, `T: AsBytes` only indicates that `T -> [u8]` is a valid transformation. This slightly changes the meaning of `AsBytes` and makes `IntoBytes` a more appropriate name since it only permits value rather than reference transmutations. This also brings the pair of `FromBytes` and `IntoBytes` in line with the standard library `From` and `Into` traits from a naming perspective. Closes #695
joshlf
added a commit
that referenced
this issue
Dec 11, 2023
Previously, `T: AsBytes` indicated that `&T -> &[u8]` was a valid transformation. As of #682, `T: AsBytes` only indicates that `T -> [u8]` is a valid transformation. This slightly changes the meaning of `AsBytes` and makes `IntoBytes` a more appropriate name since it only permits value rather than reference transmutations. This also brings the pair of `FromBytes` and `IntoBytes` in line with the standard library `From` and `Into` traits from a naming perspective. Closes #695
joshlf
added a commit
that referenced
this issue
Dec 11, 2023
Previously, `T: AsBytes` indicated that `&T -> &[u8]` was a valid transformation. As of #682, `T: AsBytes` only indicates that `T -> [u8]` is a valid transformation. This slightly changes the meaning of `AsBytes` and makes `IntoBytes` a more appropriate name since it only permits value rather than reference transmutations. This also brings the pair of `FromBytes` and `IntoBytes` in line with the standard library `From` and `Into` traits from a naming perspective. Closes #695
joshlf
added a commit
that referenced
this issue
Dec 11, 2023
Previously, `T: AsBytes` indicated that `&T -> &[u8]` was a valid transformation. As of #682, `T: AsBytes` only indicates that `T -> [u8]` is a valid transformation. This slightly changes the meaning of `AsBytes` and makes `IntoBytes` a more appropriate name since it only permits value rather than reference transmutations. This also brings the pair of `FromBytes` and `IntoBytes` in line with the standard library `From` and `Into` traits from a naming perspective. Closes #695
github-merge-queue bot
pushed a commit
that referenced
this issue
Dec 14, 2023
Previously, `T: AsBytes` indicated that `&T -> &[u8]` was a valid transformation. As of #682, `T: AsBytes` only indicates that `T -> [u8]` is a valid transformation. This slightly changes the meaning of `AsBytes` and makes `IntoBytes` a more appropriate name since it only permits value rather than reference transmutations. This also brings the pair of `FromBytes` and `IntoBytes` in line with the standard library `From` and `Into` traits from a naming perspective. Closes #695
joshlf
added a commit
that referenced
this issue
Feb 23, 2024
This makes the transition from `AsBytes` to `IntoBytes` (its new name) easier. Makes progress on #695
joshlf
added a commit
that referenced
this issue
Feb 23, 2024
This makes the transition from `AsBytes` to `IntoBytes` (its new name) easier. Makes progress on #695
joshlf
added a commit
that referenced
this issue
Feb 23, 2024
This makes the transition from `AsBytes` to `IntoBytes` (its new name) easier. Makes progress on #695
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 23, 2024
This makes the transition from `AsBytes` to `IntoBytes` (its new name) easier. Makes progress on #695
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Progress
ToBytes
andIntoBytes
IntoBytes
so thatFromBytes
/IntoBytes
is symmetrical with stdlib'sFrom
/Into
Description
Now that
AsBytes
permitsUnsafeCells
as part of #251, it can be implemented for types which support value-only transmutation (ie, for whichfn as_bytes(&self) -> &[u8] where Self: NoCell
is not available becauseSelf: !NoCell
). Given this change, a more appropriate name for the trait would beIntoBytes
. This also brings our pair ofFromBytes
/IntoBytes
into line with the existing pattern ofFrom
/Into
.The text was updated successfully, but these errors were encountered: