aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/meme/history.rs')
-rw-r--r--src/commands/meme/history.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/commands/meme/history.rs b/src/commands/meme/history.rs
index 236e47f..5a46758 100644
--- a/src/commands/meme/history.rs
+++ b/src/commands/meme/history.rs
@@ -4,8 +4,8 @@ use chrono::{
Utc,
};
use diesel::{
- result::Error as DieselError,
NotFound,
+ result::Error as DieselError,
};
use grate::tracing;
use itertools::Itertools;
@@ -33,17 +33,17 @@ use timeago::{
};
use crate::{
+ PoiseContext,
commands::game::get_user_id,
config::CONFIG,
db::{
self,
- connection,
InvocationRecord,
Meme,
Metadata,
+ connection,
},
util,
- PoiseContext,
};
lazy_static! {
@@ -76,7 +76,7 @@ pub async fn wat(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
}
util::reply(ctx, "BAD MEME BAD MEME").await?;
- return Err(e.into());
+ return Err(e);
},
};
@@ -107,7 +107,7 @@ pub async fn wat(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
}
util::reply(ctx, "do i look like i know what a jpeg is").await?;
- return Err(e.into());
+ return Err(e);
},
};
@@ -151,7 +151,7 @@ pub async fn history(ctx: PoiseContext<'_>, n: Option<usize>) -> anyhow::Result<
.then(|(i, rec)| async move {
let mut conn = connection().await?;
- let dt = chrono::Utc.from_utc_datetime(&rec.time).conv::<Timestamp>();
+ let dt = Utc.from_utc_datetime(&rec.time).conv::<Timestamp>();
let ago = FormattedTimestamp::new(dt, Some(FormattedTimestampStyle::RelativeTime));
let rand = if rec.random {
@@ -186,10 +186,10 @@ pub async fn history(ctx: PoiseContext<'_>, n: Option<usize>) -> anyhow::Result<
)
},
Err(e) => {
- if let Some(variant) = e.downcast_ref::<DieselError>() {
- if *variant != NotFound {
- tracing::error!(error = %e, "error encountered loading meme history");
- }
+ if let Some(variant) = e.downcast_ref::<DieselError>()
+ && *variant != NotFound
+ {
+ tracing::error!(error = %e, "error encountered loading meme history");
}
format!(