Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
technetos committed Aug 22, 2019
1 parent b9118d1 commit 887d719
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/api.rs
@@ -1,5 +1,5 @@
use crate::{
cache::RoleIdCache,
cache::RoleIdCache,
commands::{Args, Result},
};
use serenity::model::prelude::*;
Expand Down
8 changes: 6 additions & 2 deletions src/cache.rs
Expand Up @@ -4,7 +4,7 @@ use crate::{
schema::{messages, roles},
};
use diesel::prelude::*;
use serenity::{model::prelude::*};
use serenity::model::prelude::*;

pub(crate) struct MessageCache;

Expand Down Expand Up @@ -94,7 +94,11 @@ pub(crate) fn save_or_update_role(name: &str, role: RoleId) -> Result<()> {
Ok(())
}

pub(crate) fn save_or_update_message(name: &str, message: MessageId, channel: ChannelId) -> Result<()> {
pub(crate) fn save_or_update_message(
name: &str,
message: MessageId,
channel: ChannelId,
) -> Result<()> {
match MessageCache::get_by_name(name)? {
Some((id, _name, msg, chan)) => {
if msg != message.0.to_string() || chan != channel.0.to_string() {
Expand Down
4 changes: 1 addition & 3 deletions src/db.rs
Expand Up @@ -2,9 +2,7 @@ use crate::commands::Result;
use diesel::prelude::*;

pub(crate) fn database_connection() -> Result<PgConnection> {
Ok(PgConnection::establish(&std::env::var(
"DATABASE_URL",
)?)?)
Ok(PgConnection::establish(&std::env::var("DATABASE_URL")?)?)
}

pub(crate) fn run_migrations() -> Result<()> {
Expand Down
6 changes: 1 addition & 5 deletions src/schema.rs
Expand Up @@ -23,8 +23,4 @@ table! {
}
}

allow_tables_to_appear_in_same_query!(
messages,
roles,
tags,
);
allow_tables_to_appear_in_same_query!(messages, roles, tags,);

0 comments on commit 887d719

Please sign in to comment.