File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 88//! - [`Ipv4Address`]
99//! - [`Ipv6Address`]
1010
11- use core:: fmt:: { self , Debug , Formatter } ;
11+ use core:: fmt:: { self , Debug , Display , Formatter } ;
1212
1313/// An IPv4 internet protocol address.
1414///
@@ -48,6 +48,13 @@ impl From<[u8; 4]> for Ipv4Address {
4848 }
4949}
5050
51+ impl Display for Ipv4Address {
52+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
53+ let ip = core:: net:: Ipv4Addr :: from ( * self ) ;
54+ write ! ( f, "{}" , ip)
55+ }
56+ }
57+
5158/// An IPv6 internet protocol address.
5259///
5360/// # Conversions and Relation to [`core::net`]
@@ -86,6 +93,13 @@ impl From<[u8; 16]> for Ipv6Address {
8693 }
8794}
8895
96+ impl Display for Ipv6Address {
97+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
98+ let ip = core:: net:: Ipv6Addr :: from ( * self ) ;
99+ write ! ( f, "{}" , ip)
100+ }
101+ }
102+
89103/// An IPv4 or IPv6 internet protocol address that is ABI compatible with EFI.
90104///
91105/// Corresponds to the `EFI_IP_ADDRESS` type in the UEFI specification. This
You can’t perform that action at this time.
0 commit comments