From 24a6e961afd65b0d09b15b378e2997adde1edece Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 28 Nov 2015 11:09:39 +0100 Subject: [PATCH] Change get_commands() for latest trait change --- src/module/bm/mod.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/module/bm/mod.rs b/src/module/bm/mod.rs index 941a603a..8661cc90 100644 --- a/src/module/bm/mod.rs +++ b/src/module/bm/mod.rs @@ -1,5 +1,6 @@ use runtime::Runtime; use module::Module; +use module::CommandMap; use module::ModuleResult; use module::ModuleError; use std::path::Path; @@ -14,9 +15,7 @@ use self::header::build_header; use storage::json::parser::JsonHeaderParser; use storage::parser::FileHeaderParser; -use self::commands::add::*; -use self::commands::list::*; -use self::commands::remove::*; +use self::commands::*; pub struct BMModule { path: Option, @@ -44,12 +43,12 @@ impl Module for BMModule { Ok(()) } - fn get_commands(&self, rt: &Runtime) -> Vec { - vec![ - AddCommand::new(), - ListCommand::new(), - RemoveCommand::new(), - ] + fn get_commands(&self, rt: &Runtime) -> CommandMap { + let mut hm = CommandMap::new(); + hm.insert("add", add_command); + hm.insert("list", list_command); + hm.insert("remove", remove_command); + hm } }