1
Fork 0

Typos in some linkage

This commit is contained in:
Guillaume Gomez 2016-10-18 20:36:44 +02:00
parent 16eeeac783
commit b12f63b17a

View file

@ -1154,10 +1154,7 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
/// ///
/// For example, reading line-by-line is inefficient without using a buffer, so /// For example, reading line-by-line is inefficient without using a buffer, so
/// if you want to read by line, you'll need `BufRead`, which includes a /// if you want to read by line, you'll need `BufRead`, which includes a
/// [`read_line()`][readline] method as well as a [`lines()`][lines] iterator. /// [`read_line()`] method as well as a [`lines()`] iterator.
///
/// [readline]: #method.read_line
/// [lines]: #method.lines
/// ///
/// # Examples /// # Examples
/// ///
@ -1173,14 +1170,17 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
/// } /// }
/// ``` /// ```
/// ///
/// If you have something that implements `Read`, you can use the [`BufReader` /// If you have something that implements [`Read`], you can use the [`BufReader`
/// type][bufreader] to turn it into a `BufRead`. /// type][`BufReader`] to turn it into a `BufRead`.
/// ///
/// For example, [`File`][file] implements `Read`, but not `BufRead`. /// For example, [`File`] implements [`Read`], but not `BufRead`.
/// `BufReader` to the rescue! /// [`BufReader`] to the rescue!
/// ///
/// [bufreader]: struct.BufReader.html /// [`BufReader`]: struct.BufReader.html
/// [file]: ../fs/struct.File.html /// [`File`]: ../fs/struct.File.html
/// [`read_line()`]: #method.read_line
/// [`lines()`]: #method.lines
/// [`Read`]: trait.Read.html
/// ///
/// ``` /// ```
/// use std::io::{self, BufReader}; /// use std::io::{self, BufReader};
@ -1204,13 +1204,13 @@ pub trait BufRead: Read {
/// Fills the internal buffer of this object, returning the buffer contents. /// Fills the internal buffer of this object, returning the buffer contents.
/// ///
/// This function is a lower-level call. It needs to be paired with the /// This function is a lower-level call. It needs to be paired with the
/// [`consume`][consume] method to function properly. When calling this /// [`consume()`] method to function properly. When calling this
/// method, none of the contents will be "read" in the sense that later /// method, none of the contents will be "read" in the sense that later
/// calling `read` may return the same contents. As such, `consume` must be /// calling `read` may return the same contents. As such, [`consume()`] must
/// called with the number of bytes that are consumed from this buffer to /// be called with the number of bytes that are consumed from this buffer to
/// ensure that the bytes are never returned twice. /// ensure that the bytes are never returned twice.
/// ///
/// [consume]: #tymethod.consume /// [`consume()`]: #tymethod.consume
/// ///
/// An empty buffer returned indicates that the stream has reached EOF. /// An empty buffer returned indicates that the stream has reached EOF.
/// ///
@ -1251,21 +1251,21 @@ pub trait BufRead: Read {
/// so they should no longer be returned in calls to `read`. /// so they should no longer be returned in calls to `read`.
/// ///
/// This function is a lower-level call. It needs to be paired with the /// This function is a lower-level call. It needs to be paired with the
/// [`fill_buf`][fillbuf] method to function properly. This function does /// [`fill_buf()`] method to function properly. This function does
/// not perform any I/O, it simply informs this object that some amount of /// not perform any I/O, it simply informs this object that some amount of
/// its buffer, returned from `fill_buf`, has been consumed and should no /// its buffer, returned from [`fill_buf()`], has been consumed and should
/// longer be returned. As such, this function may do odd things if /// no longer be returned. As such, this function may do odd things if
/// `fill_buf` isn't called before calling it. /// [`fill_buf()`] isn't called before calling it.
///
/// [fillbuf]: #tymethod.fill_buf
/// ///
/// The `amt` must be `<=` the number of bytes in the buffer returned by /// The `amt` must be `<=` the number of bytes in the buffer returned by
/// `fill_buf`. /// [`fill_buf()`].
/// ///
/// # Examples /// # Examples
/// ///
/// Since `consume()` is meant to be used with [`fill_buf()`][fillbuf], /// Since `consume()` is meant to be used with [`fill_buf()`],
/// that method's example includes an example of `consume()`. /// that method's example includes an example of `consume()`.
///
/// [`fill_buf()`]: #tymethod.fill_buf
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
fn consume(&mut self, amt: usize); fn consume(&mut self, amt: usize);
@ -1279,8 +1279,8 @@ pub trait BufRead: Read {
/// ///
/// # Errors /// # Errors
/// ///
/// This function will ignore all instances of `ErrorKind::Interrupted` and /// This function will ignore all instances of [`ErrorKind::Interrupted`] and
/// will otherwise return any errors returned by `fill_buf`. /// will otherwise return any errors returned by [`fill_buf()`].
/// ///
/// If an I/O error is encountered then all bytes read so far will be /// 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. /// present in `buf` and its length will have been adjusted appropriately.
@ -1290,6 +1290,9 @@ pub trait BufRead: Read {
/// A locked standard input implements `BufRead`. In this example, we'll /// A locked standard input implements `BufRead`. In this example, we'll
/// read from standard input until we see an `a` byte. /// read from standard input until we see an `a` byte.
/// ///
/// [`fill_buf()`]: #tymethod.fill_buf
/// [`ErrorKind::Interrupted`]: enum.ErrorKind.html#variant.Interrupted
///
/// ``` /// ```
/// use std::io; /// use std::io;
/// use std::io::prelude::*; /// use std::io::prelude::*;
@ -1322,19 +1325,20 @@ pub trait BufRead: Read {
/// ///
/// # Errors /// # Errors
/// ///
/// This function has the same error semantics as `read_until` and will also /// This function has the same error semantics as [`read_until()`] and will
/// return an error if the read bytes are not valid UTF-8. If an I/O error /// also return an error if the read bytes are not valid UTF-8. If an I/O
/// is encountered then `buf` may contain some bytes already read in the /// error is encountered then `buf` may contain some bytes already read in
/// event that all data read so far was valid UTF-8. /// the event that all data read so far was valid UTF-8.
/// ///
/// # Examples /// # Examples
/// ///
/// A locked standard input implements `BufRead`. In this example, we'll /// A locked standard input implements `BufRead`. In this example, we'll
/// read all of the lines from standard input. If we were to do this in /// read all of the lines from standard input. If we were to do this in
/// an actual project, the [`lines()`][lines] method would be easier, of /// an actual project, the [`lines()`] method would be easier, of
/// course. /// course.
/// ///
/// [lines]: #method.lines /// [`lines()`]: #method.lines
/// [`read_until()`]: #method.read_until
/// ///
/// ``` /// ```
/// use std::io; /// use std::io;
@ -1363,17 +1367,21 @@ pub trait BufRead: Read {
/// `byte`. /// `byte`.
/// ///
/// The iterator returned from this function will return instances of /// The iterator returned from this function will return instances of
/// `io::Result<Vec<u8>>`. Each vector returned will *not* have the /// [`io::Result`]`<`[`Vec<u8>`]`>`. Each vector returned will *not* have
/// delimiter byte at the end. /// the delimiter byte at the end.
/// ///
/// This function will yield errors whenever `read_until` would have also /// This function will yield errors whenever [`read_until()`] would have
/// yielded an error. /// also yielded an error.
/// ///
/// # Examples /// # Examples
/// ///
/// A locked standard input implements `BufRead`. In this example, we'll /// A locked standard input implements `BufRead`. In this example, we'll
/// read some input from standard input, splitting on commas. /// read some input from standard input, splitting on commas.
/// ///
/// [`io::Result`]: type.Result.html
/// [`Vec<u8>`]: ../vec/struct.Vec.html
/// [`read_until()`]: #method.read_until
///
/// ``` /// ```
/// use std::io; /// use std::io;
/// use std::io::prelude::*; /// use std::io::prelude::*;
@ -1392,9 +1400,12 @@ pub trait BufRead: Read {
/// Returns an iterator over the lines of this reader. /// Returns an iterator over the lines of this reader.
/// ///
/// The iterator returned from this function will yield instances of /// The iterator returned from this function will yield instances of
/// `io::Result<String>`. Each string returned will *not* have a newline /// [`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`]: type.Result.html
/// [`String`]: ../string/struct.String.html
///
/// # Examples /// # Examples
/// ///
/// A locked standard input implements `BufRead`: /// A locked standard input implements `BufRead`:
@ -1417,10 +1428,10 @@ pub trait BufRead: Read {
/// Adaptor to chain together two readers. /// Adaptor to chain together two readers.
/// ///
/// This struct is generally created by calling [`chain()`][chain] on a reader. /// This struct is generally created by calling [`chain()`] on a reader.
/// Please see the documentation of `chain()` for more details. /// Please see the documentation of [`chain()`] for more details.
/// ///
/// [chain]: trait.Read.html#method.chain /// [`chain()`]: trait.Read.html#method.chain
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct Chain<T, U> { pub struct Chain<T, U> {
first: T, first: T,
@ -1581,10 +1592,10 @@ fn read_one_byte(reader: &mut Read) -> Option<Result<u8>> {
/// An iterator over `u8` values of a reader. /// An iterator over `u8` values of a reader.
/// ///
/// This struct is generally created by calling [`bytes()`][bytes] on a reader. /// This struct is generally created by calling [`bytes()`] on a reader.
/// Please see the documentation of `bytes()` for more details. /// Please see the documentation of [`bytes()`] for more details.
/// ///
/// [bytes]: trait.Read.html#method.bytes /// [`bytes()`]: trait.Read.html#method.bytes
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct Bytes<R> { pub struct Bytes<R> {
inner: R, inner: R,