diff options
| author | bors <bors@rust-lang.org> | 2021-09-25 20:08:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-25 20:08:11 +0000 |
| commit | addb4da686a97da46159f0123cb6cdc2ce3d7fdb (patch) | |
| tree | e7e29d87736398b7d7c7884b7ec17552c770a243 /library/std/src/net | |
| parent | 9620f3a84b079decfdc2e557be007580b097fe43 (diff) | |
| parent | 67065fe93366cfdd9e88440b6f876c3dfeb1f937 (diff) | |
| download | rust-addb4da686a97da46159f0123cb6cdc2ce3d7fdb.tar.gz rust-addb4da686a97da46159f0123cb6cdc2ce3d7fdb.zip | |
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`
Diffstat (limited to 'library/std/src/net')
| -rw-r--r-- | library/std/src/net/addr.rs | 17 | ||||
| -rw-r--r-- | library/std/src/net/mod.rs | 6 |
2 files changed, 11 insertions, 12 deletions
diff --git a/library/std/src/net/addr.rs b/library/std/src/net/addr.rs index 43d930677fa..f4ebcd53a25 100644 --- a/library/std/src/net/addr.rs +++ b/library/std/src/net/addr.rs @@ -765,15 +765,15 @@ impl hash::Hash for SocketAddrV6 { /// /// * [`SocketAddr`]: [`to_socket_addrs`] is the identity function. /// -/// * [`SocketAddrV4`], [`SocketAddrV6`], `(`[`IpAddr`]`, `[`u16`]`)`, -/// `(`[`Ipv4Addr`]`, `[`u16`]`)`, `(`[`Ipv6Addr`]`, `[`u16`]`)`: +/// * [`SocketAddrV4`], [`SocketAddrV6`], <code>([IpAddr], [u16])</code>, +/// <code>([Ipv4Addr], [u16])</code>, <code>([Ipv6Addr], [u16])</code>: /// [`to_socket_addrs`] constructs a [`SocketAddr`] trivially. /// -/// * `(`[`&str`]`, `[`u16`]`)`: [`&str`] should be either a string representation +/// * <code>(&[str], [u16])</code>: <code>&[str]</code> should be either a string representation /// of an [`IpAddr`] address as expected by [`FromStr`] implementation or a host /// name. [`u16`] is the port number. /// -/// * [`&str`]: the string should be either a string representation of a +/// * <code>&[str]</code>: the string should be either a string representation of a /// [`SocketAddr`] as expected by its [`FromStr`] implementation or a string like /// `<host_name>:<port>` pair where `<port>` is a [`u16`] value. /// @@ -789,11 +789,10 @@ impl hash::Hash for SocketAddrV6 { /// Addresses returned by the operating system that are not IP addresses are /// silently ignored. /// -/// [`FromStr`]: crate::str::FromStr -/// [`&str`]: str -/// [`TcpStream`]: crate::net::TcpStream +/// [`FromStr`]: crate::str::FromStr "std::str::FromStr" +/// [`TcpStream`]: crate::net::TcpStream "net::TcpStream" /// [`to_socket_addrs`]: ToSocketAddrs::to_socket_addrs -/// [`UdpSocket`]: crate::net::UdpSocket +/// [`UdpSocket`]: crate::net::UdpSocket "net::UdpSocket" /// /// # Examples /// @@ -872,7 +871,7 @@ pub trait ToSocketAddrs { #[stable(feature = "rust1", since = "1.0.0")] type Iter: Iterator<Item = SocketAddr>; - /// Converts this object to an iterator of resolved `SocketAddr`s. + /// Converts this object to an iterator of resolved [`SocketAddr`]s. /// /// The returned iterator might not actually yield any values depending on the /// outcome of any resolution performed. diff --git a/library/std/src/net/mod.rs b/library/std/src/net/mod.rs index d814e9b25ba..a0c77b648fe 100644 --- a/library/std/src/net/mod.rs +++ b/library/std/src/net/mod.rs @@ -44,16 +44,16 @@ mod udp; pub enum Shutdown { /// The reading portion of the [`TcpStream`] should be shut down. /// - /// All currently blocked and future [reads] will return [`Ok`]`(0)`. + /// All currently blocked and future [reads] will return <code>[Ok]\(0)</code>. /// - /// [reads]: crate::io::Read + /// [reads]: crate::io::Read "io::Read" #[stable(feature = "rust1", since = "1.0.0")] Read, /// The writing portion of the [`TcpStream`] should be shut down. /// /// All currently blocked and future [writes] will return an error. /// - /// [writes]: crate::io::Write + /// [writes]: crate::io::Write "io::Write" #[stable(feature = "rust1", since = "1.0.0")] Write, /// Both the reading and the writing portions of the [`TcpStream`] should be shut down. |
