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

Rename AsBytes to IntoBytes #700

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Rename AsBytes to IntoBytes #700

merged 1 commit into from
Dec 14, 2023

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented 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 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 joshlf requested a review from jswrenn December 8, 2023 23:40
@joshlf joshlf force-pushed the as-bytes-rename-to-to-bytes branch 3 times, most recently from b895345 to 6ccd880 Compare December 8, 2023 23:57
@joshlf joshlf mentioned this pull request Dec 9, 2023
2 tasks
@joshlf joshlf changed the title Rename AsBytes to ToBytes Rename AsBytes to IntoBytes Dec 11, 2023
@joshlf joshlf changed the title Rename AsBytes to IntoBytes Rename AsBytes to IntoBytes 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 joshlf added this pull request to the merge queue Dec 14, 2023
Merged via the queue into main with commit 24b5a9b Dec 14, 2023
126 checks passed
@joshlf joshlf deleted the as-bytes-rename-to-to-bytes branch December 14, 2023 18:29
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.

Rename AsBytes to IntoBytes
2 participants