Lift out Ok wrapping from match expression

This commit is contained in:
Thomas Eizinger 2021-05-21 12:24:03 +10:00
parent baf5a0896e
commit d43ba33e15
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

View File

@ -47,7 +47,7 @@ where
let is_testnet = args.testnet; let is_testnet = args.testnet;
let data = args.data; let data = args.data;
match args.cmd { let arguments = match args.cmd {
RawCommand::BuyXmr { RawCommand::BuyXmr {
seller_peer_id, seller_peer_id,
seller_addr: SellerAddr { seller_addr }, seller_addr: SellerAddr { seller_addr },
@ -62,7 +62,7 @@ where
monero_daemon_address, monero_daemon_address,
}, },
tor: Tor { tor_socks5_port }, tor: Tor { tor_socks5_port },
} => Ok(Arguments { } => Arguments {
env_config: env_config_from(is_testnet), env_config: env_config_from(is_testnet),
debug, debug,
json, json,
@ -85,14 +85,14 @@ where
), ),
tor_socks5_port, tor_socks5_port,
}, },
}), },
RawCommand::History => Ok(Arguments { RawCommand::History => Arguments {
env_config: env_config_from(is_testnet), env_config: env_config_from(is_testnet),
debug, debug,
json, json,
data_dir: data::data_dir_from(data, is_testnet)?, data_dir: data::data_dir_from(data, is_testnet)?,
cmd: Command::History, cmd: Command::History,
}), },
RawCommand::Resume { RawCommand::Resume {
swap_id: SwapId { swap_id }, swap_id: SwapId { swap_id },
seller_addr: SellerAddr { seller_addr }, seller_addr: SellerAddr { seller_addr },
@ -107,7 +107,7 @@ where
monero_daemon_address, monero_daemon_address,
}, },
tor: Tor { tor_socks5_port }, tor: Tor { tor_socks5_port },
} => Ok(Arguments { } => Arguments {
env_config: env_config_from(is_testnet), env_config: env_config_from(is_testnet),
debug, debug,
json, json,
@ -127,7 +127,7 @@ where
), ),
tor_socks5_port, tor_socks5_port,
}, },
}), },
RawCommand::Cancel { RawCommand::Cancel {
swap_id: SwapId { swap_id }, swap_id: SwapId { swap_id },
force, force,
@ -136,7 +136,7 @@ where
bitcoin_electrum_rpc_url, bitcoin_electrum_rpc_url,
bitcoin_target_block, bitcoin_target_block,
}, },
} => Ok(Arguments { } => Arguments {
env_config: env_config_from(is_testnet), env_config: env_config_from(is_testnet),
debug, debug,
json, json,
@ -150,7 +150,7 @@ where
)?, )?,
bitcoin_target_block: bitcoin_target_block_from(bitcoin_target_block, is_testnet), bitcoin_target_block: bitcoin_target_block_from(bitcoin_target_block, is_testnet),
}, },
}), },
RawCommand::Refund { RawCommand::Refund {
swap_id: SwapId { swap_id }, swap_id: SwapId { swap_id },
force, force,
@ -159,7 +159,7 @@ where
bitcoin_electrum_rpc_url, bitcoin_electrum_rpc_url,
bitcoin_target_block, bitcoin_target_block,
}, },
} => Ok(Arguments { } => Arguments {
env_config: env_config_from(is_testnet), env_config: env_config_from(is_testnet),
debug, debug,
json, json,
@ -173,8 +173,10 @@ where
)?, )?,
bitcoin_target_block: bitcoin_target_block_from(bitcoin_target_block, is_testnet), bitcoin_target_block: bitcoin_target_block_from(bitcoin_target_block, is_testnet),
}, },
}), },
} };
Ok(arguments)
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]