Auto merge of #88343 - steffahn:fix_code_spacing, r=jyn514

Fix spacing of links in inline code.

Similar to #80733, but the focus is different. This PR eliminates all occurrences of pieced-together inline code blocks like [`Box`]`<`[`Option`]`<T>>` and replaces them with good-looking ones (using HTML-syntax), like <code>[Box]<[Option]\<T>></code>. As far as I can tell, I should’ve found all of these in the standard library (regex search with `` r"`\]`|`\[`" ``) \[except for in `core::convert` where I’ve noticed other things in the docs that I want to fix in a separate PR]. In particular, unlike #80733, I’ve added almost no new instance of inline code that’s broken up into multiple links (or some link and some link-free part). I also added tooltips (the stuff in quotes for the markdown link listings) in places that caught my eye, but that’s by no means systematic, just opportunistic.

[Box]: https://doc.rust-lang.org/std/boxed/struct.Box.html "Box"
[`Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html "Box"
[Option]: https://doc.rust-lang.org/std/option/enum.Option.html "Option"
[`Option`]: https://doc.rust-lang.org/std/option/enum.Option.html "Option"

Context: I got annoyed by repeatedly running into new misformatted inline code while reading the standard library docs. I know that once issue #83997 (and/or related ones) are resolved, these changes become somewhat obsolete, but I fail to notice much progress on that end right now.

r? `@jyn514`
This commit is contained in:
bors
2021-09-25 20:08:11 +00:00
26 changed files with 225 additions and 234 deletions

View File

@@ -854,8 +854,8 @@ pub trait Read {
/// Transforms this `Read` instance to an [`Iterator`] over its bytes.
///
/// The returned type implements [`Iterator`] where the `Item` is
/// [`Result`]`<`[`u8`]`, `[`io::Error`]`>`.
/// The returned type implements [`Iterator`] where the [`Item`] is
/// <code>[Result]<[u8], [io::Error]></code>.
/// The yielded item is [`Ok`] if a byte was successfully read and [`Err`]
/// otherwise. EOF is mapped to returning [`None`] from this iterator.
///
@@ -863,9 +863,10 @@ pub trait Read {
///
/// [`File`]s implement `Read`:
///
/// [`File`]: crate::fs::File
/// [`Result`]: crate::result::Result
/// [`io::Error`]: self::Error
/// [`Item`]: Iterator::Item
/// [`File`]: crate::fs::File "fs::File"
/// [Result]: crate::result::Result "Result"
/// [io::Error]: self::Error "io::Error"
///
/// ```no_run
/// use std::io;
@@ -2191,13 +2192,13 @@ pub trait BufRead: Read {
/// `byte`.
///
/// The iterator returned from this function will return instances of
/// [`io::Result`]`<`[`Vec<u8>`]`>`. Each vector returned will *not* have
/// <code>[io::Result]<[Vec]\<u8>></code>. Each vector returned will *not* have
/// the delimiter byte at the end.
///
/// This function will yield errors whenever [`read_until`] would have
/// also yielded an error.
///
/// [`io::Result`]: self::Result
/// [io::Result]: self::Result "io::Result"
/// [`read_until`]: BufRead::read_until
///
/// # Examples
@@ -2228,10 +2229,10 @@ pub trait BufRead: Read {
/// Returns an iterator over the lines of this reader.
///
/// The iterator returned from this function will yield instances of
/// [`io::Result`]`<`[`String`]`>`. Each string returned will *not* have a newline
/// <code>[io::Result]<[String]></code>. Each string returned will *not* have a newline
/// byte (the `0xA` byte) or `CRLF` (`0xD`, `0xA` bytes) at the end.
///
/// [`io::Result`]: self::Result
/// [io::Result]: self::Result "io::Result"
///
/// # Examples
///