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

Convert BoxBytes to/from boxed slices #228

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

zachs18
Copy link
Contributor

@zachs18 zachs18 commented Mar 2, 2024

As I mentioned in a comment on the BoxBytes PR, BoxBytes logically can be converted to/from boxed slices as well as boxed Sized types. This PR extends the existing box_bytes_of/(try_)from_box_bytes using sealed traits to allow them to take/return boxed slices as well as their current boxed Sized types (and Box<str> for box_bytes_of).

semver

The relaxation of the function bounds is not a breaking change.

The change from impl<T: NoUninit> From<Box<T>> for BoxBytes to impl<T: ?Sized + BoxBytesOf> From<Box<T>> for BoxBytes I believe is not a breaking change:

  • Any type for which a downstream crate was previously allowed to implement From<Box<U>> for BoxBytes must have U as a local, non-NoUninit type, which as far as I can tell is still allowed under this new impl.

@Lokathor Lokathor merged commit a888e5f into Lokathor:main Mar 13, 2024
14 checks passed
@Lokathor
Copy link
Owner

Released bytemuck-1.15.0

Please report any compatibility problems that somehow appear.

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.

None yet

2 participants