]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #68558 - HeroicKatora:buf-writer-capacity, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 4 Feb 2020 20:30:53 +0000 (20:30 +0000)
committerbors <bors@rust-lang.org>
Tue, 4 Feb 2020 20:30:53 +0000 (20:30 +0000)
commitc9290dceee2cb6b882b26ec6e294560e51ef0853
tree4a562c7b3baab76e74d7e2f0b4cd02b2264474ee
parent5b0caef54a062b5e283cf15d1fad7027f631f29d
parentaebd0d733940d62566c66a923c7b9f7078209e98
Auto merge of #68558 - HeroicKatora:buf-writer-capacity, r=alexcrichton

Add a method to query the capacity of a BufWriter and BufReader

Besides the obvious of retrieving the parameter used to construct the writer, this method allows consumers to control the number of `flush` calls during write operations. For `BufReader` it gives an upper bound on the returned buffer in `fill_buf` which might influence the allocation behaviour of a consumer.