minor refactor

This commit is contained in:
Ellie D 2019-06-01 22:09:02 -05:00
parent 7b541432cb
commit b013ab7001
1 changed files with 10 additions and 8 deletions

View File

@ -84,14 +84,16 @@ fn main() {
Ok(address) => addresses.push(address),
};
},
Ok(n) => if arg.ends_with("p") {
println!("-i- accepting only local connections on port {}",n);
ports.push((PortPrivacy::Private,n));
} else if arg.ends_with("w") {
println!("-i- accepting only connections whitelisted in {} on port {}",ALLOWFILE_NAME,n);
ports.push((PortPrivacy::Whitelist,n));
} else {
ports.push((PortPrivacy::Public,n));
Ok(n) => match arg.chars().last() {
Some('w') => {
println!("-i- accepting only connections whitelisted in {} on port {}",ALLOWFILE_NAME,n);
ports.push((PortPrivacy::Whitelist,n));
},
Some('p') => {
println!("-i- accepting only local connections on port {}",n);
ports.push((PortPrivacy::Private,n));
},
_ => ports.push((PortPrivacy::Public,n)),
},
};
}