]> git.lizzy.rs Git - rust.git/commit
Implement Show for types in std::io::{buffered,util}
authorSteven Fackler <sfackler@gmail.com>
Sun, 11 Jan 2015 01:32:54 +0000 (17:32 -0800)
committerSteven Fackler <sfackler@gmail.com>
Sun, 11 Jan 2015 01:32:54 +0000 (17:32 -0800)
commitb4fae2fba99e713a6d6a8a59caaf1cfba847b50e
tree3e029277b399285fc863062896c1a4ed8ea0678a
parent099b411e080d302ec0dc5f3aebe53d76c50acfc7
Implement Show for types in std::io::{buffered,util}

A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.

I also altered MultiWriter to make it generic over Writers instead of
taking Box<Writer> trait objects. Box<Writer> implements Writer so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.

The change to MultiWriter may break code that uses it, but any fixes
should be easy.

[breaking-change]
src/libstd/io/buffered.rs
src/libstd/io/util.rs