From 30344b0605645d833233f1d3cf440fdee801a1e4 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Mon, 15 May 2023 22:27:54 +0100 Subject: [PATCH] Cleaned up some minor issues in main.rs making the final output easier for the end user to read and comprehend --- src/main.rs | 10 +++++++--- src/networking/mod.rs | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index c131c3f..351579a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::{io}; -use crate::networking::Network; +use networking::Network; mod networking; @@ -25,6 +25,10 @@ fn main() { break; } - let networks = Network::create_subnet(&ip_and_cidr.0, ip_and_cidr.1); - println!("IP: {}, CIDR: {}", ip_and_cidr.0.to_string(), ip_and_cidr.1); + let networks = Network::create_subnet(&ip_and_cidr.0, ip_and_cidr.1).unwrap_or_default(); + + for network in networks.iter() { + networking::ip::print_ip(network.clone()); + } + println!("There are {} networks available", networks.len()); } diff --git a/src/networking/mod.rs b/src/networking/mod.rs index 52a5c2a..3de22cd 100644 --- a/src/networking/mod.rs +++ b/src/networking/mod.rs @@ -97,7 +97,6 @@ impl Network { } } - println!("{:#?}", networks); Ok(networks) }