Skip to content

Commit 1ce98f3

Browse files
committed
Cross-reference fs::read functions from io::Read docs
1 parent 8531086 commit 1ce98f3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libstd/io/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,11 @@ pub trait Read {
595595
/// Ok(())
596596
/// }
597597
/// ```
598+
///
599+
/// (See also the [`std::fs::read`] convenience function for reading from a
600+
/// file.)
601+
///
602+
/// [`std::fs::read`]: ../fs/fn.read.html
598603
#[stable(feature = "rust1", since = "1.0.0")]
599604
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
600605
read_to_end(self, buf)
@@ -633,6 +638,11 @@ pub trait Read {
633638
/// Ok(())
634639
/// }
635640
/// ```
641+
///
642+
/// (See also the [`std::fs::read_to_string`] convenience function for
643+
/// reading from a file.)
644+
///
645+
/// [`std::fs::read_to_string`]: ../fs/fn.read_to_string.html
636646
#[stable(feature = "rust1", since = "1.0.0")]
637647
fn read_to_string(&mut self, buf: &mut String) -> Result<usize> {
638648
// Note that we do *not* call `.read_to_end()` here. We are passing

0 commit comments

Comments
 (0)