aboutsummaryrefslogtreecommitdiff
path: root/azalea-client
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-10-30 15:42:43 -0500
committermat <github@matdoes.dev>2022-10-30 15:42:43 -0500
commit5ae890f94178d824fb73b4bbd2938dff9c22e96e (patch)
tree8f7913f7121ad82b21cb70822e7bd6ed51aa5ab8 /azalea-client
parent329f8b1784b26e2149f6edb4e969e10bd419a190 (diff)
downloadazalea-drasl-5ae890f94178d824fb73b4bbd2938dff9c22e96e.tar.xz
replace an expect with unwrap_or_else
Diffstat (limited to 'azalea-client')
-rw-r--r--azalea-client/src/account.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs
index 2fedc4f5..42bfe6fc 100644
--- a/azalea-client/src/account.rs
+++ b/azalea-client/src/account.rs
@@ -46,13 +46,12 @@ impl Account {
/// a key for the cache, but it's recommended to use the real email to
/// avoid confusion.
pub async fn microsoft(email: &str) -> Result<Self, azalea_auth::AuthError> {
- let minecraft_dir = get_mc_dir::minecraft_dir().expect(
- format!(
+ let minecraft_dir = get_mc_dir::minecraft_dir().unwrap_or_else(|| {
+ panic!(
"No {} environment variable found",
get_mc_dir::home_env_var()
)
- .as_str(),
- );
+ });
let auth_result = azalea_auth::auth(
email,
azalea_auth::AuthOpts {