Skip to content

Commit

Permalink
Cross-reference fs::read functions from io::Read docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed Apr 3, 2018
1 parent 8531086 commit 1ce98f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@ pub trait Read {
/// Ok(())
/// }
/// ```
///
/// (See also the [`std::fs::read`] convenience function for reading from a
/// file.)
///
/// [`std::fs::read`]: ../fs/fn.read.html
#[stable(feature = "rust1", since = "1.0.0")]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
read_to_end(self, buf)
Expand Down Expand Up @@ -633,6 +638,11 @@ pub trait Read {
/// Ok(())
/// }
/// ```
///
/// (See also the [`std::fs::read_to_string`] convenience function for
/// reading from a file.)
///
/// [`std::fs::read_to_string`]: ../fs/fn.read_to_string.html
#[stable(feature = "rust1", since = "1.0.0")]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize> {
// Note that we do *not* call `.read_to_end()` here. We are passing
Expand Down

0 comments on commit 1ce98f3

Please sign in to comment.