]> git.lizzy.rs Git - rust.git/commitdiff
Fix nits in intra-doc links for std io
authorAlexis Bourget <alexis.bourget@gmail.com>
Wed, 19 Aug 2020 14:26:17 +0000 (16:26 +0200)
committerAlexis Bourget <alexis.bourget@gmail.com>
Wed, 19 Aug 2020 14:26:17 +0000 (16:26 +0200)
library/std/src/io/mod.rs

index f1ee3c698606296be816e56ef5a418cc503ed018..324562948382890d5ba99d7fd91bc617d8d75c7e 100644 (file)
@@ -479,11 +479,11 @@ pub(crate) fn default_write_vectored<F>(write: F, bufs: &[IoSlice<'_>]) -> Resul
 /// }
 /// ```
 ///
-/// [`read()`]: Self::read
+/// [`read()`]: Read::read
 /// [`&str`]: str
 /// [`std::io`]: self
 /// [`File`]: crate::fs::File
-/// [slice]: crate::slice
+/// [slice]: ../../std/primitive.slice.html
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(spotlight)]
 pub trait Read {
@@ -633,7 +633,7 @@ unsafe fn initializer(&self) -> Initializer {
     ///
     /// [`File`]s implement `Read`:
     ///
-    /// [`read()`]: Self::read
+    /// [`read()`]: Read::read
     /// [`Ok(0)`]: Ok
     /// [`File`]: crate::fs::File
     ///
@@ -673,7 +673,7 @@ fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
     ///
     /// See [`read_to_end`] for other error semantics.
     ///
-    /// [`read_to_end`]: Self::read_to_end
+    /// [`read_to_end`]: Read::read_to_end
     ///
     /// # Examples
     ///
@@ -746,7 +746,7 @@ fn read_to_string(&mut self, buf: &mut String) -> Result<usize> {
     ///
     /// [`File`]s implement `Read`:
     ///
-    /// [`read`]: Self::read
+    /// [`read`]: Read::read
     /// [`File`]: crate::fs::File
     ///
     /// ```no_run
@@ -1209,8 +1209,8 @@ pub fn initialize(&self, buf: &mut [u8]) {
 /// throughout [`std::io`] take and provide types which implement the `Write`
 /// trait.
 ///
-/// [`write`]: Self::write
-/// [`flush`]: Self::flush
+/// [`write`]: Write::write
+/// [`flush`]: Write::flush
 /// [`std::io`]: self
 ///
 /// # Examples
@@ -1236,7 +1236,7 @@ pub fn initialize(&self, buf: &mut [u8]) {
 /// The trait also provides convenience methods like [`write_all`], which calls
 /// `write` in a loop until its entire input has been written.
 ///
-/// [`write_all`]: Self::write_all
+/// [`write_all`]: Write::write_all
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(spotlight)]
 pub trait Write {
@@ -1296,7 +1296,7 @@ pub trait Write {
     /// The default implementation calls [`write`] with either the first nonempty
     /// buffer provided, or an empty one if none exists.
     ///
-    /// [`write`]: Self::write
+    /// [`write`]: Write::write
     #[stable(feature = "iovec", since = "1.36.0")]
     fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize> {
         default_write_vectored(|b| self.write(b), bufs)
@@ -1311,7 +1311,7 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize> {
     ///
     /// The default implementation returns `false`.
     ///
-    /// [`write_vectored`]: Self::write_vectored
+    /// [`write_vectored`]: Write::write_vectored
     #[unstable(feature = "can_vector", issue = "69941")]
     fn is_write_vectored(&self) -> bool {
         false
@@ -1359,7 +1359,7 @@ fn is_write_vectored(&self) -> bool {
     /// This function will return the first error of
     /// non-[`ErrorKind::Interrupted`] kind that [`write`] returns.
     ///
-    /// [`write`]: Self::write
+    /// [`write`]: Write::write
     ///
     /// # Examples
     ///
@@ -1400,8 +1400,6 @@ fn write_all(&mut self, mut buf: &[u8]) -> Result<()> {
     ///
     /// If the buffer contains no data, this will never call [`write_vectored`].
     ///
-    /// [`write_vectored`]: Self::write_vectored
-    ///
     /// # Notes
     ///
     /// Unlike [`write_vectored`], this takes a *mutable* reference to
@@ -1415,6 +1413,8 @@ fn write_all(&mut self, mut buf: &[u8]) -> Result<()> {
     /// [`IoSlice`]s point (but not the [`IoSlice`]s themselves), are unchanged and
     /// can be reused.
     ///
+    /// [`write_vectored`]: Write::write_vectored
+    ///
     /// # Examples
     ///
     /// ```
@@ -1467,7 +1467,7 @@ fn write_all_vectored(&mut self, mut bufs: &mut [IoSlice<'_>]) -> Result<()> {
     /// are received. This also means that partial writes are not indicated in
     /// this signature.
     ///
-    /// [`write_all`]: Self::write_all
+    /// [`write_all`]: Write::write_all
     ///
     /// # Errors
     ///
@@ -1758,8 +1758,8 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>) -> R
 /// [`BufReader`] to the rescue!
 ///
 /// [`File`]: crate::fs::File
-/// [`read_line`]: Self::read_line
-/// [`lines`]: Self::lines
+/// [`read_line`]: BufRead::read_line
+/// [`lines`]: BufRead::lines
 ///
 /// ```no_run
 /// use std::io::{self, BufReader};
@@ -1789,7 +1789,7 @@ pub trait BufRead: Read {
     /// be called with the number of bytes that are consumed from this buffer to
     /// ensure that the bytes are never returned twice.
     ///
-    /// [`consume`]: Self::consume
+    /// [`consume`]: BufRead::consume
     ///
     /// An empty buffer returned indicates that the stream has reached EOF.
     ///
@@ -1839,7 +1839,7 @@ pub trait BufRead: Read {
     /// Since `consume()` is meant to be used with [`fill_buf`],
     /// that method's example includes an example of `consume()`.
     ///
-    /// [`fill_buf`]: Self::fill_buf
+    /// [`fill_buf`]: BufRead::fill_buf
     #[stable(feature = "rust1", since = "1.0.0")]
     fn consume(&mut self, amt: usize);
 
@@ -1863,7 +1863,7 @@ pub trait BufRead: Read {
     /// If an I/O error is encountered then all bytes read so far will be
     /// present in `buf` and its length will have been adjusted appropriately.
     ///
-    /// [`fill_buf`]: Self::fill_buf
+    /// [`fill_buf`]: BufRead::fill_buf
     ///
     /// # Examples
     ///
@@ -1927,7 +1927,7 @@ fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> {
     /// error is encountered then `buf` may contain some bytes already read in
     /// the event that all data read so far was valid UTF-8.
     ///
-    /// [`read_until`]: Self::read_until
+    /// [`read_until`]: BufRead::read_until
     ///
     /// # Examples
     ///
@@ -1980,7 +1980,7 @@ fn read_line(&mut self, buf: &mut String) -> Result<usize> {
     ///
     /// [`io::Result`]: self::Result
     /// [`Vec<u8>`]: Vec
-    /// [`read_until`]: Self::read_until
+    /// [`read_until`]: BufRead::read_until
     ///
     /// # Examples
     ///
@@ -2011,7 +2011,7 @@ fn split(self, byte: u8) -> Split<Self>
     ///
     /// The iterator returned from this function will yield instances of
     /// [`io::Result`]`<`[`String`]`>`. Each string returned will *not* have a newline
-    /// byte (the `0xA` byte) or CRLF (0xD, 0xA bytes) at the end.
+    /// byte (the `0xA` byte) or `CRLF` (`0xD`, `0xA` bytes) at the end.
     ///
     /// [`io::Result`]: self::Result
     ///