make it compile again

This commit is contained in:
Carson McManus 2022-06-19 10:56:52 -04:00
parent 14d49d33b1
commit 2f4d1e3cfa

View file

@ -233,9 +233,9 @@ fn run() -> anyhow::Result<()> {
}
}
match new_args.sub {
match &new_args.sub {
Some(cli::Subcommands::Setup{ username }) => {
do_subcmd_setup(new_args.sub.unwrap().into(), &mut manifest)?;
return do_subcmd_setup(new_args.sub.unwrap().into(), &mut manifest);
},
Some(cli::Subcommands::Import { files }) => {todo!()},
Some(cli::Subcommands::Encrypt {}) => {todo!()},
@ -320,9 +320,8 @@ fn run() -> anyhow::Result<()> {
.collect::<Vec<String>>()
);
if let Some(subcmd) = new_args.sub {
match subcmd {
cli::Subcommands::Trade{ accept_all, fail_fast } => {
match new_args.sub.as_ref() {
Some(cli::Subcommands::Trade{ accept_all, fail_fast }) => {
for a in selected_accounts.iter_mut() {
let mut account = a.lock().unwrap();
@ -342,14 +341,14 @@ fn run() -> anyhow::Result<()> {
}
let mut any_failed = false;
if accept_all {
if *accept_all {
info!("accepting all confirmations");
for conf in &confirmations {
let result = account.accept_confirmation(conf);
if result.is_err() {
warn!("accept confirmation result: {:?}", result);
any_failed = true;
if fail_fast {
if *fail_fast {
return result;
}
} else {
@ -364,7 +363,7 @@ fn run() -> anyhow::Result<()> {
if result.is_err() {
warn!("accept confirmation result: {:?}", result);
any_failed = true;
if fail_fast {
if *fail_fast {
return result;
}
} else {
@ -377,7 +376,7 @@ fn run() -> anyhow::Result<()> {
if result.is_err() {
warn!("deny confirmation result: {:?}", result);
any_failed = true;
if fail_fast {
if *fail_fast {
return result;
}
} else {
@ -399,7 +398,7 @@ fn run() -> anyhow::Result<()> {
manifest.save()?;
},
cli::Subcommands::Remove { username } => {
Some(cli::Subcommands::Remove { username }) => {
println!(
"This will remove the mobile authenticator from {} accounts: {}",
selected_accounts.len(),
@ -457,11 +456,12 @@ fn run() -> anyhow::Result<()> {
manifest.save()?;
},
s => {
Some(s) => {
error!("Unknown subcommand: {:?}", s);
},
}
} else {
_ => {
debug!("No subcommand given, assuming user wants a 2fa code");
let server_time = steamapi::get_server_time();
debug!("Time used to generate codes: {}", server_time);
for account in selected_accounts {
@ -474,6 +474,7 @@ fn run() -> anyhow::Result<()> {
println!("{}", code);
}
}
}
Ok(())
}