diff options
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs index 3cab8c3..0166a88 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,6 +1,6 @@ use crate::{client::Context, consts::Colors}; -use color_eyre::eyre::{eyre, Result}; +use anyhow::{Context as _, Result}; use poise::serenity_prelude::{self as serenity, CreateEmbedAuthor, CreateEmbedFooter}; use poise::CreateReply; use rand::seq::SliceRandom; @@ -14,7 +14,7 @@ pub fn random_choice<const N: usize>(arr: [&str; N]) -> Result<String> { let mut rng = rand::thread_rng(); let resp = arr .choose(&mut rng) - .ok_or_else(|| eyre!("Couldn't choose random object from array:\n{arr:#?}!"))?; + .with_context(|| format!("Couldn't choose random object from array:\n{arr:#?}!"))?; Ok((*resp).to_string()) } |
