diff --git a/hammond-data/src/errors.rs b/hammond-data/src/errors.rs new file mode 100644 index 0000000..f892d2b --- /dev/null +++ b/hammond-data/src/errors.rs @@ -0,0 +1,18 @@ +use diesel::migrations::RunMigrationsError; +use diesel::result; +use rss; +use hyper; +use reqwest; + +use std::io; + +error_chain! { + foreign_links { + MigrationError(RunMigrationsError); + DieselResultError(result::Error); + RSSError(rss::Error); + HyperError(hyper::error::Error); + ReqError(reqwest::Error); + IoError(io::Error); + } +} diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 9729ccd..b7ab700 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -15,12 +15,12 @@ extern crate diesel; #[macro_use] extern crate diesel_codegen; +extern crate hyper; extern crate rayon; extern crate reqwest; -extern crate hyper; -extern crate xdg; -extern crate rss; extern crate rfc822_sanitizer; +extern crate rss; +extern crate xdg; pub mod dbqueries; pub mod models; @@ -28,27 +28,7 @@ pub mod schema; pub mod index_feed; pub mod feedparser; - -pub mod errors { - - use diesel::migrations::RunMigrationsError; - use diesel::result; - use rss; - use hyper; - use reqwest; - use std::io; - - error_chain! { - foreign_links { - MigrationError(RunMigrationsError); - DieselResultError(result::Error); - RSSError(rss::Error); - HyperError(hyper::error::Error); - ReqError(reqwest::Error); - IoError(io::Error); - } - } -} +pub mod errors; use errors::*; use diesel::prelude::*;