cargo fmt
This commit is contained in:
parent
4ac3c09338
commit
1ffe464ed8
2 changed files with 14 additions and 4 deletions
|
@ -145,7 +145,10 @@ impl Manifest {
|
||||||
let file = File::open(path)?;
|
let file = File::open(path)?;
|
||||||
let reader = BufReader::new(file);
|
let reader = BufReader::new(file);
|
||||||
let account: SteamGuardAccount = serde_json::from_reader(reader)?;
|
let account: SteamGuardAccount = serde_json::from_reader(reader)?;
|
||||||
ensure!(!self.account_exists(&account.account_name), "Account already exists in manifest, please remove it first.");
|
ensure!(
|
||||||
|
!self.account_exists(&account.account_name),
|
||||||
|
"Account already exists in manifest, please remove it first."
|
||||||
|
);
|
||||||
self.add_account(account);
|
self.add_account(account);
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -213,9 +213,13 @@ fn main() {
|
||||||
print!("Username: ");
|
print!("Username: ");
|
||||||
let username = tui::prompt();
|
let username = tui::prompt();
|
||||||
if manifest.account_exists(&username) {
|
if manifest.account_exists(&username) {
|
||||||
error!("Account {} already exists in manifest, remove it first", username);
|
error!(
|
||||||
|
"Account {} already exists in manifest, remove it first",
|
||||||
|
username
|
||||||
|
);
|
||||||
}
|
}
|
||||||
let session = do_login_raw(username).expect("Failed to log in. Account has not been linked.");
|
let session =
|
||||||
|
do_login_raw(username).expect("Failed to log in. Account has not been linked.");
|
||||||
|
|
||||||
let mut linker = AccountLinker::new(session);
|
let mut linker = AccountLinker::new(session);
|
||||||
let account: SteamGuardAccount;
|
let account: SteamGuardAccount;
|
||||||
|
@ -461,7 +465,10 @@ fn main() {
|
||||||
"Failed to remove authenticator from {}",
|
"Failed to remove authenticator from {}",
|
||||||
account.account_name
|
account.account_name
|
||||||
);
|
);
|
||||||
match tui::prompt_char("Would you like to remove it from the manifest anyway?", "yN") {
|
match tui::prompt_char(
|
||||||
|
"Would you like to remove it from the manifest anyway?",
|
||||||
|
"yN",
|
||||||
|
) {
|
||||||
'y' => {
|
'y' => {
|
||||||
successful.push(account.account_name.clone());
|
successful.push(account.account_name.clone());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue