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 { - 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 { diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index d9465062..636981f3 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -122,7 +122,6 @@ where /// # Examples /// /// ```rust - /// use anyhow::Result; /// use azalea::prelude::*; /// /// async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> {