Skip to content

Commit

Permalink
ip v6 or v4
Browse files Browse the repository at this point in the history
  • Loading branch information
mothsART committed May 2, 2021
1 parent 969c023 commit 4c1dfba
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,28 @@ fn main() {
if let Some(ip) = matches.subcommand_matches("internet.ip") {
use fake::faker::internet::raw::{IPv4, IPv6};

let val: String;
if let Some(_) = ip.args.get("ipv4") {
let val: String = IPv4(EN).fake();
val = IPv4(EN).fake();
println!("{}", val);
return;
}
if let Some(_) = ip.args.get("ipv6") {
let val: String = IPv6(EN).fake();
val = IPv6(EN).fake();
println!("{}", val);
return;
}

use fake::faker::boolean::en;

if en::Boolean(50).fake() {
val = IPv4(EN).fake();
println!("{}", val);
return;
}
val = IPv6(EN).fake();
println!("{}", val);
return;
}

if let Some(_) = matches.subcommand_matches("internet.mac") {
Expand Down

0 comments on commit 4c1dfba

Please sign in to comment.