Created
December 25, 2017 02:41
-
-
Save panicbit/4b3039f70d7bcdfe3bfb00ada4f1f811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate cidr; | |
use cidr::{Ipv4Inet,Inet}; | |
fn main() { | |
let ip = "10.61.3.123".parse().unwrap(); | |
let ip = Ipv4Inet::new(ip, 24).unwrap(); | |
println!("{}", ip.network()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment