Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Consider renaming Buffer::len #1430

@emilk

Description

@emilk

I was very surprised to learn that Buffer::len returns the number of bytes in the buffer, NOT the number of elements. This is very counter-intuitive and also goes against the docstring for Buffer, which states: The easiest way to think about Buffer<T> is being equivalent to a Arc<Vec<T>>

I suggest deprecating len and adding and adding two new methods, num_bytes and num_elements (or similar).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions