aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remind/mod.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2018-06-16 15:35:49 +0200
committerJokler <jokler.contact@gmail.com>2018-06-16 15:35:49 +0200
commit9baade2a5d9fec54fe4d88216fbdb91c154ad348 (patch)
treee4bee7605f2c2738574ad7d7a671c8b843bf53b5 /src/plugins/remind/mod.rs
parent768fcc68af3cc57f52ac7117cbf325479836159a (diff)
downloadfrippy-9baade2a5d9fec54fe4d88216fbdb91c154ad348.tar.gz
frippy-9baade2a5d9fec54fe4d88216fbdb91c154ad348.zip
Fix clippy warnings
Diffstat (limited to 'src/plugins/remind/mod.rs')
-rw-r--r--src/plugins/remind/mod.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/remind/mod.rs b/src/plugins/remind/mod.rs
index fada1fb..fa7cf70 100644
--- a/src/plugins/remind/mod.rs
+++ b/src/plugins/remind/mod.rs
@@ -98,7 +98,7 @@ impl<T: 'static + Database> Remind<T> {
let events = Arc::new(RwLock::new(db));
Remind {
- events: events,
+ events,
has_reminder: RwLock::new(false),
}
}
@@ -106,17 +106,17 @@ impl<T: 'static + Database> Remind<T> {
fn user_cmd(&self, command: PluginCommand) -> Result<String, RemindError> {
let parser = CommandParser::parse_target(command.tokens)?;
- self.set(parser, &command.source)
+ self.set(&parser, &command.source)
}
fn me_cmd(&self, command: PluginCommand) -> Result<String, RemindError> {
let source = command.source.clone();
let parser = CommandParser::with_target(command.tokens, command.source)?;
- self.set(parser, &source)
+ self.set(&parser, &source)
}
- fn set(&self, parser: CommandParser, author: &str) -> Result<String, RemindError> {
+ fn set(&self, parser: &CommandParser, author: &str) -> Result<String, RemindError> {
debug!("parser: {:?}", parser);
let target = parser.get_target();
@@ -125,7 +125,7 @@ impl<T: 'static + Database> Remind<T> {
let event = database::NewEvent {
receiver: target,
content: &parser.get_message(),
- author: author,
+ author,
time: &time,
repeat: parser
.get_repeat(Duration::from_secs(600))?
@@ -212,9 +212,10 @@ impl<T: Database> Plugin for Remind<T> {
fn command(&self, client: &IrcClient, mut command: PluginCommand) -> Result<(), FrippyError> {
if command.tokens.is_empty() {
- return Ok(client
+ client
.send_notice(&command.source, &ErrorKind::InvalidCommand.to_string())
- .context(FrippyErrorKind::Connection)?);
+ .context(FrippyErrorKind::Connection)?;
+ return Ok(());
}
let source = command.source.clone();
@@ -229,7 +230,7 @@ impl<T: Database> Plugin for Remind<T> {
_ => Err(ErrorKind::InvalidCommand.into()),
};
- let result = match response {
+ match response {
Ok(msg) => client
.send_notice(&source, &msg)
.context(FrippyErrorKind::Connection)?,
@@ -242,9 +243,9 @@ impl<T: Database> Plugin for Remind<T> {
Err(e).context(FrippyErrorKind::Remind)?
}
- };
+ }
- Ok(result)
+ Ok(())
}
fn evaluate(&self, _: &IrcClient, _: PluginCommand) -> Result<String, String> {