Closed ethe closed 6 months ago
Thanks for the PR. I'm in favor of accepting this as std::io::BufReader does the same thing. https://doc.rust-lang.org/nightly/std/io/struct.BufReader.html
That said, I think it would be good to remove the bound from not only these accessors, but also from non constructor methods such as buffer
, as std::io::BufReader does.
I totally agree, I do the same thing on other non custructor methods just now.
Currently, accessing the inner of
futures::io::{BufReader, BufWriter}
requires that the inner type implementsAsyncRead
orAsyncWrite
. This constraint is much stricter than the semantics of inner access require. Removing the trait bound would be helpful in cases where pass-through functions simply obtain a reference to the inner I/O object for further use, without having to specify the inner trait bound explicitly.