aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorNathan Perry <avaglir@gmail.com>2018-08-13 19:51:07 -0400
committerNathan Perry <avaglir@gmail.com>2018-08-13 19:51:07 -0400
commit831a906e8e422ff2bf294e5496c3a6acef804d8e (patch)
treef1263a067d8b70d51590eb6ff9c782421368483f /src/commands
parenta064941bd542a4d66ac1452bd876fef91b0bf87f (diff)
update for 2018 edition
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/meme.rs9
-rw-r--r--src/commands/mod.rs2
-rw-r--r--src/commands/roll.rs2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/commands/meme.rs b/src/commands/meme.rs
index 44e29f1..3fd9db3 100644
--- a/src/commands/meme.rs
+++ b/src/commands/meme.rs
@@ -5,19 +5,20 @@ use serenity::framework::standard::Args;
use diesel::PgConnection;
use failure::Error;
use std::sync::RwLock;
+use lazy_static::lazy_static;
use super::*;
use super::playback::CtxExt;
-use db::*;
-use Result;
+use crate::db::*;
+use crate::Result;
lazy_static! {
static ref LAST_MEME: RwLock<Option<i32>> = RwLock::new(None);
}
fn update_meme(meme: &Meme) -> Result<()> {
- let mut opt = LAST_MEME.write().map_err(|_| ::failure::err_msg("unable to acquire lock"))?;
+ let mut opt = LAST_MEME.write().map_err(|_| crate::failure::err_msg("unable to acquire lock"))?;
*opt = Some(meme.id);
Ok(())
@@ -69,7 +70,7 @@ pub fn wat(_: &mut Context, msg: &Message, _: Args) -> Result<()> {
match meme {
Ok(ref meme) => {
let metadata = Metadata::find(&conn, meme.metadata_id)?;
- let author = ::TARGET_GUILD_ID.member(metadata.created_by as u64)?;
+ let author = crate::TARGET_GUILD_ID.member(metadata.created_by as u64)?;
send(msg.channel_id,
&format!("that was \"{}\" by {} ({})",
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 4d7b4ae..bf55b90 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -1,4 +1,4 @@
-use {must_env_lookup, Result, TARGET_GUILD_ID};
+use crate::{must_env_lookup, Result, TARGET_GUILD_ID};
use serenity::framework::StandardFramework;
use serenity::model::channel::Message;
use serenity::model::id::ChannelId;
diff --git a/src/commands/roll.rs b/src/commands/roll.rs
index 8ceb285..55b5429 100644
--- a/src/commands/roll.rs
+++ b/src/commands/roll.rs
@@ -4,7 +4,7 @@ use serenity::model::channel::Message;
use regex::Regex;
use rand::prelude::*;
-use Result;
+use crate::Result;
use super::send;