Skip to content

Buffer::empty should not allocate #5044

@gatesn

Description

@gatesn

Describe the bug

Currently Buffer::empty goes via BufferMut::empty, but this forces an allocation.

If we use Bytes::empty instead, then it refers to a static empty bytes slice. Alignment checks may fail.. which we'll need to figure out.

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions