Skip to content

Instantly share code, notes, and snippets.

@panicbit
Created December 25, 2017 02:41
Show Gist options
  • Save panicbit/4b3039f70d7bcdfe3bfb00ada4f1f811 to your computer and use it in GitHub Desktop.
Save panicbit/4b3039f70d7bcdfe3bfb00ada4f1f811 to your computer and use it in GitHub Desktop.
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