8

Github Let io::copy reuse BufWriter buffers by the8472 · Pull Request #78641 · r...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/78641
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Contributor

the8472 commented on Nov 2, 2020

edited

This optimization will allow users to implicitly set the buffer size for io::copy by wrapping the writer into a BufWriter if the default block size is insufficient, which should fix #49921

Due to min_specialization limitations this approach only works with BufWriter but not for BufReader<R> since R is unconstrained and thus the necessary specialization on R: Read is not always applicable. Once specialization becomes more powerful this optimization could be extended to look at the reader and writer side and use whichever buffer is larger.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK