Change get_commands() for latest trait change

This commit is contained in:
Matthias Beyer 2015-11-28 11:09:39 +01:00
parent 8af9ba48c0
commit 24a6e961af

View file

@ -1,5 +1,6 @@
use runtime::Runtime; use runtime::Runtime;
use module::Module; use module::Module;
use module::CommandMap;
use module::ModuleResult; use module::ModuleResult;
use module::ModuleError; use module::ModuleError;
use std::path::Path; use std::path::Path;
@ -14,9 +15,7 @@ use self::header::build_header;
use storage::json::parser::JsonHeaderParser; use storage::json::parser::JsonHeaderParser;
use storage::parser::FileHeaderParser; use storage::parser::FileHeaderParser;
use self::commands::add::*; use self::commands::*;
use self::commands::list::*;
use self::commands::remove::*;
pub struct BMModule { pub struct BMModule {
path: Option<String>, path: Option<String>,
@ -44,12 +43,12 @@ impl Module for BMModule {
Ok(()) Ok(())
} }
fn get_commands<EC: ExecutableCommand>(&self, rt: &Runtime) -> Vec<EC> { fn get_commands(&self, rt: &Runtime) -> CommandMap {
vec![ let mut hm = CommandMap::new();
AddCommand::new(), hm.insert("add", add_command);
ListCommand::new(), hm.insert("list", list_command);
RemoveCommand::new(), hm.insert("remove", remove_command);
] hm
} }
} }