diff rust/rhg/src/commands.rs @ 45438:ed95ccc94333

rhg: pass `ui` to `Command` `run` Allow implementation of `From<clap::ArgMatches> for Command` Differential Revision: https://phab.mercurial-scm.org/D8954
author Antoine Cezar <antoine.cezar@octobus.net>
date Tue, 04 Aug 2020 16:11:23 +0200
parents 5fe25f8ef5d9
children 66756b34c06e
line wrap: on
line diff
--- a/rust/rhg/src/commands.rs	Mon Aug 03 11:55:59 2020 +0200
+++ b/rust/rhg/src/commands.rs	Tue Aug 04 16:11:23 2020 +0200
@@ -1,10 +1,11 @@
 pub mod files;
 pub mod root;
 use crate::error::CommandError;
+use crate::ui::Ui;
 
 /// The common trait for rhg commands
 ///
 /// Normalize the interface of the commands provided by rhg
-pub trait Command<'a> {
-    fn run(&self) -> Result<(), CommandError>;
+pub trait Command {
+    fn run(&self, ui: &Ui) -> Result<(), CommandError>;
 }