minor refactor
This commit is contained in:
parent
7b541432cb
commit
b013ab7001
18
sunbeam.rs
18
sunbeam.rs
|
@ -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)),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue