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).
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 forBuffer
, 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
andnum_elements
(or similar).