Skip to content

Safe method for creating UninitSlice #552

@Rossterd

Description

@Rossterd

When implementing BufMut the BufMut::chunk_mut method requires you to return an UninitSlice instance.
As UninitSlice only has the unsafe from_raw_parts() constructor, this means that even if your slice is definitely already initiated you still need to write unsafe code to return this slice.

This isn't great, and it would be nice to have a way to safely create a UninitSlice from a slice of already initiated data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions