]> git.lizzy.rs Git - rust.git/commit
Change Debug impl of SocketAddr and IpAddr to match their Display output
authorLukas Kalbertodt <lukas.kalbertodt@gmail.com>
Thu, 16 Jul 2020 19:29:09 +0000 (21:29 +0200)
committerLukas Kalbertodt <lukas.kalbertodt@gmail.com>
Tue, 28 Jul 2020 15:48:47 +0000 (17:48 +0200)
commit6293dca1e880394d90fe80055216328fe4d9702e
tree1fb1c8ab21bb65f2760d0eb20a9945ca8c95adec
parent1f5d69daccd1f04e42886d9aaf513f2691132d17
Change Debug impl of SocketAddr and IpAddr to match their Display output

This has already been done for `SocketAddrV4`, `SocketAddrV6`,
`IpAddrV4` and `IpAddrV6`. I don't see a point to keep the rather bad
to read derived impl, especially when pretty printing:

    V4(
        127.0.0.1
    )

From the `Display`, one can easily and unambiguously see if it's V4 or
V6. Using `Display` as `Debug` is very convenient for configuration
structs (e.g. for webservers) that often just have a `derive(Debug)`
and are printed that way to the user.
library/std/src/net/addr.rs
library/std/src/net/ip.rs