From b58b03c22d637fe8f7200edb6953325bf359544d Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 7 Aug 2024 07:39:16 -0400 Subject: split calc into separate subcrate --- src/bot.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/bot.rs') diff --git a/src/bot.rs b/src/bot.rs index 6a2ae72..4942c98 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -57,10 +57,8 @@ use crate::{ err_msg, util, util::OAUTH_URL, - Error, PoiseContext, PoiseData, - Result, }; pub struct HttpKey; @@ -151,8 +149,8 @@ lazy_static! { let restrict_path = CONFIG.restrict.as_ref().unwrap_or(&default_path); let restrict_ids = File::open(restrict_path) - .map_err(Error::from) - .and_then(|f| serde_json::from_reader::<_, Vec>(f).map_err(Error::from)); + .map_err(anyhow::Error::from) + .and_then(|f| serde_json::from_reader::<_, Vec>(f).map_err(anyhow::Error::from)); if let Err(ref e) = restrict_ids { warn!("opening restrict file: {}", e); @@ -211,7 +209,7 @@ fn on_err(err: FrameworkError) -> BoxFuture<()> { fn noop( _ctx: PrefixContext<'_, U, E>, - ) -> BoxFuture>> { + ) -> BoxFuture>> { Box::pin(async { Ok(()) }) } @@ -365,7 +363,7 @@ fn after_handle(ctx: PoiseContext) -> BoxFuture<()> { }) } -pub async fn run() -> Result<()> { +pub async fn run() -> anyhow::Result<()> { let token = &CONFIG.discord.auth.token; let sb_config = songbird::Config::default(); -- cgit v1.3.1