From bc8367617e534f82629141989ed0e5d019d4add2 Mon Sep 17 00:00:00 2001 From: Camelid Date: Wed, 12 Aug 2020 15:09:55 -0700 Subject: [PATCH 1/2] Switch to intra-doc links in `std/io/mod.rs` --- library/std/src/io/mod.rs | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 9eb54c2cc00..cbb53997120 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -1212,7 +1212,6 @@ impl Initializer { /// /// [`write`]: Self::write /// [`flush`]: Self::flush -/// [`std::io`]: index.html /// /// # Examples /// @@ -1590,8 +1589,6 @@ pub trait Seek { /// # Errors /// /// Seeking to a negative offset is considered an error. - /// - /// [`SeekFrom::Start`]: enum.SeekFrom.html#variant.Start #[stable(feature = "rust1", since = "1.0.0")] fn seek(&mut self, pos: SeekFrom) -> Result; @@ -1678,8 +1675,6 @@ pub trait Seek { /// Enumeration of possible methods to seek within an I/O object. /// /// It is used by the [`Seek`] trait. -/// -/// [`Seek`]: trait.Seek.html #[derive(Copy, PartialEq, Eq, Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub enum SeekFrom { @@ -1759,11 +1754,9 @@ fn read_until(r: &mut R, delim: u8, buf: &mut Vec) -> R /// For example, [`File`] implements [`Read`], but not `BufRead`. /// [`BufReader`] to the rescue! /// -/// [`BufReader`]: struct.BufReader.html /// [`File`]: crate::fs::File /// [`read_line`]: Self::read_line /// [`lines`]: Self::lines -/// [`Read`]: trait.Read.html /// /// ```no_run /// use std::io::{self, BufReader}; @@ -1869,7 +1862,6 @@ pub trait BufRead: Read { /// present in `buf` and its length will have been adjusted appropriately. /// /// [`fill_buf`]: Self::fill_buf - /// [`ErrorKind::Interrupted`]: enum.ErrorKind.html#variant.Interrupted /// /// # Examples /// @@ -1877,8 +1869,6 @@ pub trait BufRead: Read { /// this example, we use [`Cursor`] to read all the bytes in a byte slice /// in hyphen delimited segments: /// - /// [`Cursor`]: struct.Cursor.html - /// /// ``` /// use std::io::{self, BufRead}; /// @@ -1940,8 +1930,6 @@ pub trait BufRead: Read { /// [`std::io::Cursor`][`Cursor`] is a type that implements `BufRead`. In /// this example, we use [`Cursor`] to read all the lines in a byte slice: /// - /// [`Cursor`]: struct.Cursor.html - /// /// ``` /// use std::io::{self, BufRead}; /// @@ -1996,8 +1984,6 @@ pub trait BufRead: Read { /// this example, we use [`Cursor`] to iterate over all hyphen delimited /// segments in a byte slice /// - /// [`Cursor`]: struct.Cursor.html - /// /// ``` /// use std::io::{self, BufRead}; /// @@ -2046,8 +2032,6 @@ pub trait BufRead: Read { /// # Errors /// /// Each line of the iterator has the same error semantics as [`BufRead::read_line`]. - /// - /// [`BufRead::read_line`]: trait.BufRead.html#method.read_line #[stable(feature = "rust1", since = "1.0.0")] fn lines(self) -> Lines where @@ -2062,7 +2046,7 @@ pub trait BufRead: Read { /// This struct is generally created by calling [`chain`] on a reader. /// Please see the documentation of [`chain`] for more details. /// -/// [`chain`]: trait.Read.html#method.chain +/// [`chain`]: Read::chain #[stable(feature = "rust1", since = "1.0.0")] pub struct Chain { first: T, @@ -2204,7 +2188,7 @@ impl BufRead for Chain { /// This struct is generally created by calling [`take`] on a reader. /// Please see the documentation of [`take`] for more details. /// -/// [`take`]: trait.Read.html#method.take +/// [`take`]: Read::take #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Take { @@ -2403,7 +2387,7 @@ impl BufRead for Take { /// This struct is generally created by calling [`bytes`] on a reader. /// Please see the documentation of [`bytes`] for more details. /// -/// [`bytes`]: trait.Read.html#method.bytes +/// [`bytes`]: Read::bytes #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Bytes { @@ -2433,7 +2417,7 @@ impl Iterator for Bytes { /// This struct is generally created by calling [`split`] on a `BufRead`. /// Please see the documentation of [`split`] for more details. /// -/// [`split`]: trait.BufRead.html#method.split +/// [`split`]: BufRead::split #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Split { @@ -2465,7 +2449,7 @@ impl Iterator for Split { /// This struct is generally created by calling [`lines`] on a `BufRead`. /// Please see the documentation of [`lines`] for more details. /// -/// [`lines`]: trait.BufRead.html#method.lines +/// [`lines`]: BufRead::lines #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct Lines { From a7749fe451c37ec192b282ec7303b9809b49df93 Mon Sep 17 00:00:00 2001 From: Camelid Date: Wed, 12 Aug 2020 15:30:15 -0700 Subject: [PATCH 2/2] Fix intra-doc link --- library/std/src/io/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index cbb53997120..e90ee5c285f 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -1212,6 +1212,7 @@ impl Initializer { /// /// [`write`]: Self::write /// [`flush`]: Self::flush +/// [`std::io`]: self /// /// # Examples ///