1
Fork 0

Cross-reference fs::read functions from io::Read docs

This commit is contained in:
Matt Brubeck 2018-04-02 09:11:07 -07:00
parent 85310860c2
commit 1ce98f34d3

View file

@ -595,6 +595,11 @@ pub trait Read {
/// Ok(()) /// 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")] #[stable(feature = "rust1", since = "1.0.0")]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> { fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
read_to_end(self, buf) read_to_end(self, buf)
@ -633,6 +638,11 @@ pub trait Read {
/// Ok(()) /// 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")] #[stable(feature = "rust1", since = "1.0.0")]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize> { fn read_to_string(&mut self, buf: &mut String) -> Result<usize> {
// Note that we do *not* call `.read_to_end()` here. We are passing // Note that we do *not* call `.read_to_end()` here. We are passing