aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/factoid/database.rs3
-rw-r--r--src/plugins/quote/mod.rs5
-rw-r--r--src/plugins/remind/mod.rs6
-rw-r--r--src/plugins/remind/parser.rs6
-rw-r--r--src/plugins/sed.rs2
-rw-r--r--src/plugins/unicode.rs5
6 files changed, 16 insertions, 11 deletions
diff --git a/src/plugins/factoid/database.rs b/src/plugins/factoid/database.rs
index 5e7e24c..e82bd27 100644
--- a/src/plugins/factoid/database.rs
+++ b/src/plugins/factoid/database.rs
@@ -130,7 +130,8 @@ impl Database for Arc<Pool<ConnectionManager<MysqlConnection>>> {
factoids::table
.filter(columns::name.eq(name))
.filter(columns::idx.eq(idx)),
- ).execute(conn)
+ )
+ .execute(conn)
{
Ok(v) => {
if v > 0 {
diff --git a/src/plugins/quote/mod.rs b/src/plugins/quote/mod.rs
index 97740c9..1eba861 100644
--- a/src/plugins/quote/mod.rs
+++ b/src/plugins/quote/mod.rs
@@ -124,10 +124,7 @@ impl<T: Database, C: Client> Quote<T, C> {
.get_channel_quote(channel, idx)
.context(ErrorKind::NotFound)?;
- format!(
- "\"{}\" - {}[{}]",
- quote.content, quote.quotee, quote.idx
- )
+ format!("\"{}\" - {}[{}]", quote.content, quote.quotee, quote.idx)
};
Ok(response)
diff --git a/src/plugins/remind/mod.rs b/src/plugins/remind/mod.rs
index 1e464b4..b03aebc 100644
--- a/src/plugins/remind/mod.rs
+++ b/src/plugins/remind/mod.rs
@@ -140,7 +140,8 @@ impl<T: Database + 'static, C: FrippyClient> Remind<T, C> {
debug!("New event: {:?}", event);
- Ok(self.events
+ Ok(self
+ .events
.write()
.insert_event(&event)
.map(|id| format!("Created reminder with id {} at {} UTC", id, time))?)
@@ -168,7 +169,8 @@ impl<T: Database + 'static, C: FrippyClient> Remind<T, C> {
.remove(0)
.parse::<i64>()
.context(ErrorKind::Parsing)?;
- let event = self.events
+ let event = self
+ .events
.read()
.get_event(id)
.context(ErrorKind::NotFound)?;
diff --git a/src/plugins/remind/parser.rs b/src/plugins/remind/parser.rs
index 965ad99..b9682df 100644
--- a/src/plugins/remind/parser.rs
+++ b/src/plugins/remind/parser.rs
@@ -204,7 +204,8 @@ impl CommandParser {
now.tm_year + 1900,
now.tm_mon as u32 + 1,
now.tm_mday as u32,
- ).ok_or(ErrorKind::InvalidDate)?;
+ )
+ .ok_or(ErrorKind::InvalidDate)?;
let time_today = today.and_time(time);
@@ -219,7 +220,8 @@ impl CommandParser {
}
}
} else {
- Ok(date.expect("At this point date has to be set")
+ Ok(date
+ .expect("At this point date has to be set")
.and_hms(0, 0, 0))
}
}
diff --git a/src/plugins/sed.rs b/src/plugins/sed.rs
index 3b2ffa4..e8a34b5 100644
--- a/src/plugins/sed.rs
+++ b/src/plugins/sed.rs
@@ -3,7 +3,7 @@ use std::marker::PhantomData;
use antidote::RwLock;
use circular_queue::CircularQueue;
-use regex::{Regex, RegexBuilder, Captures};
+use regex::{Captures, Regex, RegexBuilder};
use irc::client::prelude::*;
diff --git a/src/plugins/unicode.rs b/src/plugins/unicode.rs
index 9ba71c3..a78422d 100644
--- a/src/plugins/unicode.rs
+++ b/src/plugins/unicode.rs
@@ -50,7 +50,10 @@ impl<C: FrippyClient> Unicode<C> {
if bytes.len() > 1 {
format!(
"{} is '{}' | UTF-8: {2:#x} ({2}), Bytes: [{3}]",
- character, name, character as u32, bytes.join(",")
+ character,
+ name,
+ character as u32,
+ bytes.join(",")
)
} else {
format!(