]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #19431 : erickt/rust/buf-writer-error, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 6 Dec 2014 20:12:13 +0000 (20:12 +0000)
committerbors <bors@rust-lang.org>
Sat, 6 Dec 2014 20:12:13 +0000 (20:12 +0000)
Previously, `BufWriter::write` would just return an `std::io::OtherIoError` if someone attempted to write past the end of the wrapped buffer. This pull request changes the error to support partial writes and return a `std::io::ShortWrite`, or an `io::io::EndOfFile` if it's been fully exhausted.

 I've also optimized away a bounds check inside `BufWriter::write`, which should help shave off some nanoseconds in an inner loops.

1  2 
src/libstd/io/mem.rs

Simple merge