aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hooks/intensify.rs11
-rw-r--r--src/hooks/pet.rs9
-rw-r--r--src/hooks/sed.rs2
-rw-r--r--src/lib.rs6
-rw-r--r--src/util/mod.rs2
5 files changed, 21 insertions, 9 deletions
diff --git a/src/hooks/intensify.rs b/src/hooks/intensify.rs
index 4c63598..8e8a817 100644
--- a/src/hooks/intensify.rs
+++ b/src/hooks/intensify.rs
@@ -1,4 +1,4 @@
-use anyhow::{Result, Context};
+use anyhow::{Context, Result};
use irc::client::prelude::*;
use macros::privmsg;
@@ -10,8 +10,13 @@ pub fn intensify(bot: &crate::Bot, msg: Message) -> Result<()> {
let content = chars.as_str();
bot.send_privmsg(
- msg.response_target().context("failed to get response target")?,
- format!("\x02\x0304[\x1d{} INTENSIFIES\x1d]\x03\x0F", content.to_uppercase()).as_str(),
+ msg.response_target()
+ .context("failed to get response target")?,
+ format!(
+ "\x02\x0304[\x1d{} INTENSIFIES\x1d]\x03\x0F",
+ content.to_uppercase()
+ )
+ .as_str(),
)?;
})
}
diff --git a/src/hooks/pet.rs b/src/hooks/pet.rs
index 4dec176..3e2defe 100644
--- a/src/hooks/pet.rs
+++ b/src/hooks/pet.rs
@@ -1,6 +1,6 @@
use std::str;
-use anyhow::{Result, Context};
+use anyhow::{Context, Result};
use irc::client::prelude::*;
use macros::privmsg;
@@ -26,8 +26,11 @@ const PET_RESPONSE: [&str; 5] = [
pub fn pet(bot: &crate::Bot, msg: Message) -> Result<()> {
privmsg!(msg, {
bot.send_action(
- msg.response_target().context("failed to get response target")?,
- PET_RESPONSE.choose(&mut thread_rng()).context("failed choosing a pet response")?,
+ msg.response_target()
+ .context("failed to get response target")?,
+ PET_RESPONSE
+ .choose(&mut thread_rng())
+ .context("failed choosing a pet response")?,
)?;
})
}
diff --git a/src/hooks/sed.rs b/src/hooks/sed.rs
index 6d6583c..120ac7d 100644
--- a/src/hooks/sed.rs
+++ b/src/hooks/sed.rs
@@ -1,4 +1,4 @@
-use anyhow::{Context, Result, anyhow, bail};
+use anyhow::{anyhow, bail, Context, Result};
use irc::client::prelude::*;
use sedregex::ReplaceCommand;
diff --git a/src/lib.rs b/src/lib.rs
index 37e9d89..56f64a5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -32,7 +32,11 @@ impl Bot {
let irc_client = Client::from_config(config.clone().into()).await?;
- let bot = Bot { irc_client, config, figment };
+ let bot = Bot {
+ irc_client,
+ config,
+ figment,
+ };
if bot.config.server.sasl && bot.config.user.password.is_some() {
tracing::info!("initializing sasl");
diff --git a/src/util/mod.rs b/src/util/mod.rs
index 9442257..a8988c3 100644
--- a/src/util/mod.rs
+++ b/src/util/mod.rs
@@ -1,2 +1,2 @@
-pub mod web;
pub mod formatting;
+pub mod web;