aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/sed.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/sed.rs
parent768fcc68af3cc57f52ac7117cbf325479836159a (diff)
downloadfrippy-9baade2a5d9fec54fe4d88216fbdb91c154ad348.tar.gz
frippy-9baade2a5d9fec54fe4d88216fbdb91c154ad348.zip
Fix clippy warnings
Diffstat (limited to 'src/plugins/sed.rs')
-rw-r--r--src/plugins/sed.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/sed.rs b/src/plugins/sed.rs
index f766809..368f5d4 100644
--- a/src/plugins/sed.rs
+++ b/src/plugins/sed.rs
@@ -26,7 +26,7 @@ pub struct Sed {
impl Sed {
pub fn new(per_channel: usize) -> Sed {
Sed {
- per_channel: per_channel,
+ per_channel,
channel_messages: RwLock::new(HashMap::new()),
}
}
@@ -35,7 +35,7 @@ impl Sed {
let mut channel_messages = self.channel_messages.write();
let messages = channel_messages
.entry(channel)
- .or_insert(CircularQueue::with_capacity(self.per_channel));
+ .or_insert_with(|| CircularQueue::with_capacity(self.per_channel));
messages.push(message);
}
@@ -150,12 +150,14 @@ impl Plugin for Sed {
}
fn command(&self, client: &IrcClient, command: PluginCommand) -> Result<(), FrippyError> {
- Ok(client
+ client
.send_notice(
&command.source,
"Currently this Plugin does not implement any commands.",
)
- .context(FrippyErrorKind::Connection)?)
+ .context(FrippyErrorKind::Connection)?;
+
+ Ok(())
}
fn evaluate(&self, _: &IrcClient, _: PluginCommand) -> Result<String, String> {