diff options
| author | J. Cliff Dyer <jcd@sdf.org> | 2017-09-07 19:06:57 -0400 |
|---|---|---|
| committer | J. Cliff Dyer <jcd@sdf.org> | 2017-09-07 19:06:57 -0400 |
| commit | ad170f23397f9da8d2180c4a48981808bf5535c9 (patch) | |
| tree | d88d6e43451ecaf0bf011c06cd80172dbb54da24 /src/libstd | |
| parent | c22db3db6d18141e21ea79cd6e0118177850b1b9 (diff) | |
| download | rust-ad170f23397f9da8d2180c4a48981808bf5535c9.tar.gz rust-ad170f23397f9da8d2180c4a48981808bf5535c9.zip | |
Close doc examples and trim whitespace.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/net/ip.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index d6387fdd659..a3775d30aa8 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -351,6 +351,7 @@ impl Ipv4Addr { /// /// let addr = Ipv4Addr::localhost(); /// assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1)); + /// ``` pub fn localhost() -> Ipv4Addr { Ipv4Addr::new(127, 0, 0, 1) } @@ -364,6 +365,7 @@ impl Ipv4Addr { /// /// let addr = Ipv4Addr::unspecified(); /// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0)); + /// ``` pub fn unspecified() -> Ipv4Addr { Ipv4Addr::new(0, 0, 0, 0) } @@ -823,6 +825,7 @@ impl Ipv6Addr { /// /// let addr = Ipv6Addr::localhost(); /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)); + /// ``` pub fn localhost() -> Ipv6Addr { Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1) } @@ -836,6 +839,7 @@ impl Ipv6Addr { /// /// let addr = Ipv6Addr::unspecified(); /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)); + /// ``` pub fn unspecified() -> Ipv6Addr { Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0) } @@ -1748,7 +1752,7 @@ mod tests { assert_eq!(Ipv6Addr::unspecified(), Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)); assert!(Ipv6Addr::unspecified().is_unspecified()); } - + #[test] fn ipv4_from_octets() { assert_eq!(Ipv4Addr::from([127, 0, 0, 1]), Ipv4Addr::new(127, 0, 0, 1)) |
