From 7e7ec6b5cd78d16c260b251dfd69cc150332f83d Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 20 Jul 2015 14:41:00 -0400 Subject: [PATCH] Document structures in std::io::utils These provide various special readers, so point their docs to their constructor functions in a manner consistent with everything else. --- src/libstd/io/util.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index c0bced26beff..dc29811ed5ba 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -61,6 +61,11 @@ pub fn copy(reader: &mut R, writer: &mut W) -> io::Result io::Result<&[u8]> { Ok(&[]) } fn consume(&mut self, _n: usize) {} } -/// A reader which infinitely yields one byte. +/// A reader which yields one byte over and over and over and over and over and... +/// +/// This struct is generally created by calling [`repeat()`][repeat]. Please +/// see the documentation of `repeat()` for more details. +/// +/// [empty]: fn.repeat.html #[stable(feature = "rust1", since = "1.0.0")] pub struct Repeat { byte: u8 } @@ -117,6 +127,11 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result { } /// A writer which will move data into the void. +/// +/// This struct is generally created by calling [`sink()`][sink]. Please +/// see the documentation of `sink()` for more details. +/// +/// [empty]: fn.sink.html #[stable(feature = "rust1", since = "1.0.0")] pub struct Sink { _priv: () }