diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/main.rs b/src/main.rs index b9085bb..bdf913a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,11 @@ -#![recursion_limit = "1024"] +#![feature(impl_trait_in_bindings)] extern crate chrono; extern crate clap; extern crate dirs; +#[allow(unused_imports)] #[macro_use] -extern crate error_chain; +extern crate failure; #[macro_use] extern crate lazy_static; extern crate rayon; @@ -17,28 +18,35 @@ extern crate serde_json; extern crate serde_yaml; extern crate toml; -pub mod actions; -pub mod match_handler; -pub mod migration_handler; -pub mod parser; -pub mod structs; -pub mod utils; -pub mod errors { - error_chain! {} +mod actions; +mod arg_parser; +mod command_handler; +mod commands; +mod download; +mod migration_handler; +mod parser; +mod playback; +mod structs; +mod utils; + +mod errors { + use failure::Error; + use std::result; + pub type Result<T> = result::Result<T, Error>; } -use self::errors::*; use self::structs::*; +use errors::Result; -const VERSION: &str = "0.9.1"; +const VERSION: &str = "0.10.0"; fn main() -> Result<()> { - utils::create_directories().chain_err(|| "unable to create directories")?; - migration_handler::migrate_old_subscriptions()?; - let mut state = State::new(VERSION).chain_err(|| "unable to load state")?; + utils::create_directories()?; + migration_handler::migrate()?; + let mut state = State::new(VERSION)?; let config = Config::new()?; let mut app = parser::get_app(&VERSION); let matches = app.clone().get_matches(); - match_handler::handle_matches(&VERSION, &mut state, &config, &mut app, &matches)?; - state.save().chain_err(|| "unable to save state") + command_handler::handle_matches(&VERSION, &mut state, &config, &mut app, &matches)?; + state.save() } |
