diff --git a/src/main.rs b/src/main.rs index 9e0d695..cac86fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,15 +9,15 @@ fn main() { loop { let mut ip = String::new(); io::stdin().read_line(&mut ip).unwrap(); - let ip_address = match IpAddr::from_str(x) { + + let ip_address = match IpAddr::from_str(&ip.trim()) { Err(_) => { - println!("fucked it"); - IpAddr::V4(0, 0, 0, 0) + println!("{} is an invalid IP Address... Please try again", ip); + continue; }, Ok(ip) => ip, }; println!("you entered, {:?}", ip_address); } - }