impl BufMut for ReadBuf (?) #5588
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-io
Module: tokio/io
I came across this bit of code in hyper:
(where
prefix: Bytes
andbuf: &mut ReadBuf<'_>
), and realized that this could be made (somewhat) simpler ifReadBuf
implementedbytes::BufMut
:Is there an API reason ReadBuf doesn't implement
BufMut
undercfg_io_util! {}
? I saw #3884 but that seems to be the opposite direction and is also a helper method, rather than acfg()
'd impl. Not sure if tokio would wanna do those, since it could maybe be more of an API hazard. An alternative is to have a likefn as_buf_mut(&mut self) -> ReadBufBufMut
helper, either intokio
or intokio-util
. IMO this is core enough that it's not necessary to stick it intokio-util
, sincetokio
depends onBufMut
already and it's a very simple mapping from ReadBuf -> BufMut (like, 15 LOC).The text was updated successfully, but these errors were encountered: