summary refs log tree commit diff
path: root/src/libstd/io/util.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-12-30 21:01:36 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-12-30 21:01:36 +1100
commitb7832ed0b42a2d6512e3f8d09605986237f02ed5 (patch)
tree313e9f72ae737775db85764279a79122f4d8b458 /src/libstd/io/util.rs
parentfea5aa656ff4349f4d3e1fea1447d26986762ae1 (diff)
downloadrust-b7832ed0b42a2d6512e3f8d09605986237f02ed5.tar.gz
rust-b7832ed0b42a2d6512e3f8d09605986237f02ed5.zip
Implement `Clone` for a large number of iterators & other adaptors.
It's useful to be able to save state.
Diffstat (limited to 'src/libstd/io/util.rs')
-rw-r--r--src/libstd/io/util.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs
index 43893ca0126..3624f14e440 100644
--- a/src/libstd/io/util.rs
+++ b/src/libstd/io/util.rs
@@ -163,6 +163,7 @@ impl Writer for MultiWriter {
 
 /// A `Reader` which chains input from multiple `Reader`s, reading each to
 /// completion before moving onto the next.
+#[deriving(Clone)]
 pub struct ChainedReader<I, R> {
     readers: I,
     cur_reader: Option<R>,
@@ -246,6 +247,7 @@ pub fn copy<R: Reader, W: Writer>(r: &mut R, w: &mut W) -> io::IoResult<()> {
 }
 
 /// An adaptor converting an `Iterator<u8>` to a `Reader`.
+#[deriving(Clone)]
 pub struct IterReader<T> {
     iter: T,
 }