Lift out `Ok` wrapping from match expression

pull/521/head
Thomas Eizinger 3 years ago
parent baf5a0896e
commit d43ba33e15
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

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

Loading…
Cancel
Save