aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/currency.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/currency.rs
parent768fcc68af3cc57f52ac7117cbf325479836159a (diff)
downloadfrippy-9baade2a5d9fec54fe4d88216fbdb91c154ad348.tar.gz
frippy-9baade2a5d9fec54fe4d88216fbdb91c154ad348.zip
Fix clippy warnings
Diffstat (limited to 'src/plugins/currency.rs')
-rw-r--r--src/plugins/currency.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/plugins/currency.rs b/src/plugins/currency.rs
index 091c238..5790c70 100644
--- a/src/plugins/currency.rs
+++ b/src/plugins/currency.rs
@@ -7,8 +7,8 @@ use std::num::ParseFloatError;
use irc::client::prelude::*;
-use self::reqwest::Client;
use self::reqwest::header::Connection;
+use self::reqwest::Client;
use self::serde_json::Value;
use plugin::*;
@@ -88,7 +88,7 @@ impl Currency {
"{} {} => {:.4} {}",
request.value,
request.source.to_lowercase(),
- response / 1.00000000,
+ response,
request.target.to_lowercase()
);
@@ -125,24 +125,28 @@ impl Plugin for Currency {
fn command(&self, client: &IrcClient, mut command: PluginCommand) -> Result<(), FrippyError> {
if command.tokens.is_empty() {
- return Ok(client
+ client
.send_notice(&command.source, &self.invalid_command())
- .context(FrippyErrorKind::Connection)?);
+ .context(FrippyErrorKind::Connection)?;
+
+ return Ok(());
}
match command.tokens[0].as_ref() {
- "help" => Ok(client
+ "help" => client
.send_notice(&command.source, self.help())
- .context(FrippyErrorKind::Connection)?),
+ .context(FrippyErrorKind::Connection)?,
_ => match self.convert(&mut command) {
- Ok(msg) => Ok(client
+ Ok(msg) => client
.send_privmsg(&command.target, &msg)
- .context(FrippyErrorKind::Connection)?),
- Err(msg) => Ok(client
+ .context(FrippyErrorKind::Connection)?,
+ Err(msg) => client
.send_notice(&command.source, &msg)
- .context(FrippyErrorKind::Connection)?),
+ .context(FrippyErrorKind::Connection)?,
},
}
+
+ Ok(())
}
fn evaluate(&self, _: &IrcClient, mut command: PluginCommand) -> Result<String, String> {