diff options
| author | seth <[email protected]> | 2024-02-18 18:30:42 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-18 18:38:30 -0500 |
| commit | c6446aa74006ab73059e316917791c5230d1e897 (patch) | |
| tree | d9d74191a7f220a275a6fb1341bd894ba3f2372f /src/commands | |
| parent | db362aefe343e2cb27d6c01c89464b0a8100b295 (diff) | |
use newer eyre directly
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/general/ask.rs | 2 | ||||
| -rw-r--r-- | src/commands/general/bing.rs | 2 | ||||
| -rw-r--r-- | src/commands/general/config.rs | 4 | ||||
| -rw-r--r-- | src/commands/general/convert.rs | 2 | ||||
| -rw-r--r-- | src/commands/general/mod.rs | 2 | ||||
| -rw-r--r-- | src/commands/general/random.rs | 2 | ||||
| -rw-r--r-- | src/commands/general/version.rs | 2 | ||||
| -rw-r--r-- | src/commands/mod.rs | 2 | ||||
| -rw-r--r-- | src/commands/moderation/clear.rs | 2 | ||||
| -rw-r--r-- | src/commands/moderation/mod.rs | 2 | ||||
| -rw-r--r-- | src/commands/optional/copypasta.rs | 6 | ||||
| -rw-r--r-- | src/commands/optional/mod.rs | 2 | ||||
| -rw-r--r-- | src/commands/optional/teawiespam.rs | 2 | ||||
| -rw-r--r-- | src/commands/optional/uwurandom.rs | 2 |
14 files changed, 17 insertions, 17 deletions
diff --git a/src/commands/general/ask.rs b/src/commands/general/ask.rs index 7775fb7..75560e0 100644 --- a/src/commands/general/ask.rs +++ b/src/commands/general/ask.rs @@ -1,6 +1,6 @@ use crate::{consts, utils, Context}; -use color_eyre::eyre::{Context as _, Result}; +use eyre::{Context as _, Result}; /// Ask teawie a question! #[poise::command(prefix_command, slash_command)] diff --git a/src/commands/general/bing.rs b/src/commands/general/bing.rs index 93c630b..d55d8ee 100644 --- a/src/commands/general/bing.rs +++ b/src/commands/general/bing.rs @@ -1,6 +1,6 @@ use crate::Context; -use color_eyre::eyre::Result; +use eyre::Result; /// Make sure the wie is alive #[poise::command(prefix_command)] diff --git a/src/commands/general/config.rs b/src/commands/general/config.rs index b60683b..ddc5cda 100644 --- a/src/commands/general/config.rs +++ b/src/commands/general/config.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use crate::{storage, Context}; use storage::{Properties, Settings}; -use color_eyre::eyre::{eyre, Result}; +use eyre::{OptionExt as _, Result}; use log::debug; use poise::serenity_prelude::{CreateEmbed, GuildChannel, ReactionType}; use poise::{ChoiceParameter, CreateReply}; @@ -148,7 +148,7 @@ pub async fn get( ) -> Result<()> { let gid = &ctx .guild_id() - .ok_or_else(|| eyre!("Failed to get GuildId from context!"))?; + .ok_or_eyre("Failed to get GuildId from context!")?; let settings = ctx.data().storage.get_guild_settings(gid).await?; let value = prop_to_val(&setting, &settings); diff --git a/src/commands/general/convert.rs b/src/commands/general/convert.rs index 1dd7f60..5e14175 100644 --- a/src/commands/general/convert.rs +++ b/src/commands/general/convert.rs @@ -1,7 +1,7 @@ use crate::Context; use bottomify::bottom; -use color_eyre::eyre::Result; +use eyre::Result; use poise::serenity_prelude::constants::MESSAGE_CODE_LIMIT; #[allow(clippy::unused_async)] diff --git a/src/commands/general/mod.rs b/src/commands/general/mod.rs index 1031d5b..c872272 100644 --- a/src/commands/general/mod.rs +++ b/src/commands/general/mod.rs @@ -1,6 +1,6 @@ use crate::Data; -use color_eyre::eyre::Report; +use eyre::Report; use poise::Command; mod ask; diff --git a/src/commands/general/random.rs b/src/commands/general/random.rs index 477001e..7c7ceff 100644 --- a/src/commands/general/random.rs +++ b/src/commands/general/random.rs @@ -1,6 +1,6 @@ use crate::{api, consts, utils, Context}; -use color_eyre::eyre::Result; +use eyre::Result; #[allow(clippy::unused_async)] #[poise::command(slash_command, subcommands("lore", "teawie", "shiggy"))] diff --git a/src/commands/general/version.rs b/src/commands/general/version.rs index 202607c..e392903 100644 --- a/src/commands/general/version.rs +++ b/src/commands/general/version.rs @@ -1,7 +1,7 @@ use crate::colors::Colors; use crate::Context; -use color_eyre::eyre::Result; +use eyre::Result; use poise::serenity_prelude::CreateEmbed; use poise::CreateReply; diff --git a/src/commands/mod.rs b/src/commands/mod.rs index db661e6..88a47b3 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,6 +1,6 @@ use crate::Data; -use color_eyre::eyre::Report; +use eyre::Report; use poise::Command; mod general; diff --git a/src/commands/moderation/clear.rs b/src/commands/moderation/clear.rs index 677dc14..bfc9c38 100644 --- a/src/commands/moderation/clear.rs +++ b/src/commands/moderation/clear.rs @@ -1,6 +1,6 @@ use crate::Context; -use color_eyre::eyre::{Context as _, Result}; +use eyre::{Context as _, Result}; use log::debug; use poise::serenity_prelude::futures::{StreamExt, TryStreamExt}; diff --git a/src/commands/moderation/mod.rs b/src/commands/moderation/mod.rs index 218ad16..5a8cd08 100644 --- a/src/commands/moderation/mod.rs +++ b/src/commands/moderation/mod.rs @@ -1,6 +1,6 @@ use crate::Data; -use color_eyre::eyre::Report; +use eyre::Report; use poise::Command; mod clear; diff --git a/src/commands/optional/copypasta.rs b/src/commands/optional/copypasta.rs index b7e7365..15171f8 100644 --- a/src/commands/optional/copypasta.rs +++ b/src/commands/optional/copypasta.rs @@ -2,7 +2,7 @@ use crate::Context; use std::collections::HashMap; -use color_eyre::eyre::{eyre, Result}; +use eyre::{eyre, OptionExt, Result}; use include_dir::{include_dir, Dir}; use log::debug; @@ -43,11 +43,11 @@ fn get_copypasta(name: &Copypastas) -> Result<String> { .file_stem() .ok_or_else(|| eyre!("Couldn't get file stem from {file:#?}"))? .to_str() - .ok_or_else(|| eyre!("Couldn't convert file stem to str!"))?; + .ok_or_eyre("Couldn't convert file stem to str!")?; let contents = file .contents_utf8() - .ok_or_else(|| eyre!("Couldnt get contents from copypasta!"))?; + .ok_or_eyre("Couldnt get contents from copypasta!")?; // refer to files by their name w/o extension files.insert(name, contents); diff --git a/src/commands/optional/mod.rs b/src/commands/optional/mod.rs index 8ef7757..39abdcb 100644 --- a/src/commands/optional/mod.rs +++ b/src/commands/optional/mod.rs @@ -1,6 +1,6 @@ use crate::Data; -use color_eyre::eyre::Report; +use eyre::Report; use poise::Command; mod copypasta; diff --git a/src/commands/optional/teawiespam.rs b/src/commands/optional/teawiespam.rs index 1ec237e..7f7ba79 100644 --- a/src/commands/optional/teawiespam.rs +++ b/src/commands/optional/teawiespam.rs @@ -1,6 +1,6 @@ use crate::Context; -use color_eyre::eyre::Result; +use eyre::Result; use log::debug; /// teawie will spam you. diff --git a/src/commands/optional/uwurandom.rs b/src/commands/optional/uwurandom.rs index c8405a0..312e54f 100644 --- a/src/commands/optional/uwurandom.rs +++ b/src/commands/optional/uwurandom.rs @@ -1,6 +1,6 @@ use crate::Context; -use color_eyre::eyre::Result; +use eyre::Result; use log::debug; use rand::Rng; |
