mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-05 06:10:15 +00:00
refine clap::Parser
This commit is contained in:
parent
ea5ee834db
commit
2a8e31225c
2 changed files with 2 additions and 5 deletions
|
@ -181,8 +181,7 @@ impl Default for Args {
|
|||
impl Args {
|
||||
#[allow(clippy::let_and_return)]
|
||||
pub fn parse_args() -> Self {
|
||||
use clap::Parser;
|
||||
let args = Self::parse();
|
||||
let args = <Self as ::clap::Parser>::parse();
|
||||
#[cfg(target_os = "linux")]
|
||||
if !args.setup && args.tun.is_none() {
|
||||
eprintln!("Missing required argument, '--tun' must present when '--setup' is not used.");
|
||||
|
|
|
@ -54,10 +54,8 @@ pub struct UdpGwArgs {
|
|||
}
|
||||
|
||||
impl UdpGwArgs {
|
||||
#[allow(clippy::let_and_return)]
|
||||
pub fn parse_args() -> Self {
|
||||
use clap::Parser;
|
||||
Self::parse()
|
||||
<Self as ::clap::Parser>::parse()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue