From 8af9ba48c04cd5ebfe79a02d62a5fda70c6e166b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 28 Nov 2015 11:23:27 +0100 Subject: [PATCH] We dont need the command traits anymore --- src/module/bm/mod.rs | 1 - src/module/command.rs | 21 --------------------- src/module/mod.rs | 4 +--- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 src/module/command.rs diff --git a/src/module/bm/mod.rs b/src/module/bm/mod.rs index 86273652..941a603a 100644 --- a/src/module/bm/mod.rs +++ b/src/module/bm/mod.rs @@ -13,7 +13,6 @@ mod commands; use self::header::build_header; use storage::json::parser::JsonHeaderParser; use storage::parser::FileHeaderParser; -use module::command::ExecutableCommand; use self::commands::add::*; use self::commands::list::*; diff --git a/src/module/command.rs b/src/module/command.rs deleted file mode 100644 index 9581cc85..00000000 --- a/src/module/command.rs +++ /dev/null @@ -1,21 +0,0 @@ -use std::result::Result; - -use clap::ArgMatches; - -use runtime::Runtime; -use super::ModuleError; -use storage::backend::{StorageBackend, StorageBackendError}; - -pub type CommandError = Result; -pub type CommandResult = Result<(), Result>; - -pub struct CommandEnv<'a> { - pub rt: &'a Runtime<'a>, - pub matches: &'a ArgMatches<'a, 'a>, - pub backend: StorageBackend -} - -pub trait ExecutableCommand { - fn get_callname() -> &'static str; - fn exec(&self, env: CommandEnv) -> CommandResult; -} diff --git a/src/module/mod.rs b/src/module/mod.rs index d45d494b..a027321a 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -6,10 +6,8 @@ use std::fmt::Display; use std::result::Result; use std::collections::HashMap; -use storage::backend::StorageBackend; -use self::command::ExecutableCommand; +use storage::backend::{StorageBackend, StorageBackendError}; -pub mod command; pub mod bm; #[derive(Debug)]