Skip to content

Commit

Permalink
added cfg for linux in example
Browse files Browse the repository at this point in the history
  • Loading branch information
JustBobinAround committed Feb 20, 2024
1 parent dd89b34 commit 3b9ddf1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/show_ip_and_ifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ fn main() {
Err(err) => println!("Failed to get local IPv6: {}", err),
};

// this is only supported on linux currently
#[cfg(target_os = "linux")]
match local_broadcast_ip() {
Ok(ip) => println!("Local broadcast IPv4: {}", ip),
Err(err) => println!("Failed to get local broadcast IPv4: {}", err),
Expand Down

0 comments on commit 3b9ddf1

Please sign in to comment.