diff options
| author | Max Audron <audron@cocaine.farm> | 2021-10-16 16:36:52 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-10-16 16:36:52 +0200 |
| commit | 3a79df9523429c0ee36825328455fff9dfb4669a (patch) | |
| tree | b646ab79e883860d97b01d682cca9f7ec8047a94 /src/hooks/pet.rs | |
| parent | rework configuration to allow extensibility by hooks (diff) | |
format code
Diffstat (limited to 'src/hooks/pet.rs')
| -rw-r--r-- | src/hooks/pet.rs | 9 |
1 files changed, 6 insertions, 3 deletions
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")?, )?; }) } |
