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 8
8
//! - [`Ipv4Address`]
9
9
//! - [`Ipv6Address`]
10
10
11
- use core:: fmt:: { self , Debug , Formatter } ;
11
+ use core:: fmt:: { self , Debug , Display , Formatter } ;
12
12
13
13
/// An IPv4 internet protocol address.
14
14
///
@@ -48,6 +48,13 @@ impl From<[u8; 4]> for Ipv4Address {
48
48
}
49
49
}
50
50
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
+
51
58
/// An IPv6 internet protocol address.
52
59
///
53
60
/// # Conversions and Relation to [`core::net`]
@@ -86,6 +93,13 @@ impl From<[u8; 16]> for Ipv6Address {
86
93
}
87
94
}
88
95
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
+
89
103
/// An IPv4 or IPv6 internet protocol address that is ABI compatible with EFI.
90
104
///
91
105
/// Corresponds to the `EFI_IP_ADDRESS` type in the UEFI specification. This
You can’t perform that action at this time.
0 commit comments