diff options
Diffstat (limited to 'fun/paroxysm')
-rw-r--r-- | fun/paroxysm/default.nix | 7 | ||||
-rw-r--r-- | fun/paroxysm/src/cfg.rs | 1 | ||||
-rw-r--r-- | fun/paroxysm/src/keyword.rs | 1 | ||||
-rw-r--r-- | fun/paroxysm/src/main.rs | 24 | ||||
-rw-r--r-- | fun/paroxysm/src/models.rs | 2 |
5 files changed, 16 insertions, 19 deletions
diff --git a/fun/paroxysm/default.nix b/fun/paroxysm/default.nix index 214f2fdcba85..b6eefc7a2eb1 100644 --- a/fun/paroxysm/default.nix +++ b/fun/paroxysm/default.nix @@ -7,5 +7,10 @@ pkgs.naersk.buildPackage { name = "paroxysm"; version = "0.0.1"; src = ./.; - buildInputs = [pkgs.openssl pkgs.pkgconfig pkgs.postgresql.lib]; + + buildInputs = with pkgs; [ + openssl + pkgconfig + postgresql.lib + ]; } diff --git a/fun/paroxysm/src/cfg.rs b/fun/paroxysm/src/cfg.rs index 038795a6f114..76afb9c651a7 100644 --- a/fun/paroxysm/src/cfg.rs +++ b/fun/paroxysm/src/cfg.rs @@ -1,4 +1,5 @@ use std::collections::HashSet; +use serde_derive::Deserialize; // TODO(tazjin): move away from serde_derive #[derive(Deserialize)] pub struct Config { diff --git a/fun/paroxysm/src/keyword.rs b/fun/paroxysm/src/keyword.rs index 9c5ea47ea523..16d962ab0544 100644 --- a/fun/paroxysm/src/keyword.rs +++ b/fun/paroxysm/src/keyword.rs @@ -2,6 +2,7 @@ use crate::models::{Entry, Keyword, NewEntry, NewKeyword}; use diesel::pg::PgConnection; use diesel::prelude::*; use failure::Error; +use failure::format_err; use std::borrow::Cow; /// Maximum number of times we'll follow a `see: ` pointer. diff --git a/fun/paroxysm/src/main.rs b/fun/paroxysm/src/main.rs index 510cf0461b89..a5382e9c0bd5 100644 --- a/fun/paroxysm/src/main.rs +++ b/fun/paroxysm/src/main.rs @@ -1,27 +1,16 @@ -extern crate irc; -extern crate serde; -#[macro_use] -extern crate serde_derive; -#[macro_use] -extern crate diesel; -extern crate chrono; -extern crate config; -extern crate env_logger; -#[macro_use] -extern crate log; -#[macro_use] -extern crate failure; -extern crate regex; -#[macro_use] -extern crate lazy_static; -extern crate rand; +// TODO(tazjin): Upgrade to a Diesel version with public derive +// macros. +#[macro_use] extern crate diesel; use crate::cfg::Config; use crate::keyword::KeywordDetails; use diesel::pg::PgConnection; use diesel::r2d2::{ConnectionManager, Pool}; use failure::Error; +use failure::format_err; use irc::client::prelude::*; +use lazy_static::lazy_static; +use log::{debug, info, warn}; use rand::rngs::ThreadRng; use rand::{thread_rng, Rng}; use regex::{Captures, Regex}; @@ -275,6 +264,7 @@ impl App { } pub fn handle_privmsg(&mut self, from: &str, chan: &str, msg: &str) -> Result<(), Error> { + // TODO(tazjin): Move these to the top. lazy_static! { static ref LEARN_RE: Regex = Regex::new(r#"^\?\?(?P<gen>!)?\s*(?P<subj>[^\[:]*):\s*(?P<val>.*)"#).unwrap(); diff --git a/fun/paroxysm/src/models.rs b/fun/paroxysm/src/models.rs index 721efbbb2e61..734a248e8f8a 100644 --- a/fun/paroxysm/src/models.rs +++ b/fun/paroxysm/src/models.rs @@ -1,5 +1,5 @@ -use crate::schema::{entries, keywords}; use chrono::NaiveDateTime; +use crate::schema::{entries, keywords}; #[derive(Queryable)] pub struct Keyword { |