Skip to content

Commit f21788d

Browse files
committed
uefi-raw convenience
1 parent b273789 commit f21788d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

uefi-raw/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,19 @@ impl From<IpAddr> for IpAddress {
194194
}
195195
}
196196

197+
impl From<&IpAddr> for IpAddress {
198+
fn from(t: &IpAddr) -> Self {
199+
match t {
200+
IpAddr::V4(ip) => Self {
201+
v4: Ipv4Addr::from(*ip),
202+
},
203+
IpAddr::V6(ip) => Self {
204+
v6: Ipv6Addr::from(*ip),
205+
},
206+
}
207+
}
208+
}
209+
197210
impl From<[u8; 16]> for IpAddress {
198211
fn from(value: [u8; 16]) -> Self {
199212
Self {

0 commit comments

Comments
 (0)