Closed cjwcommuny closed 5 months ago
@braddunbar I would like to write a function like:
fn foo(x: impl Into<Bytes>) {}
foo(b"hello");
foo(Bytes::new());
I believe that implementing <&[u8; N]>
for Bytes
would improve the ergonomics.
Hmmm... It seems that the "const generics" requires Rust 1.51+...
Due to the const generics issue, we are unlikely to add this feature at this time.
Hey @cjwcommuny! Out of curiosity, are you having an issue using
Bytes::copy_from_slice
directly or is this about the convenience of callingfrom
/into
?