Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/commands.rs @ 46500:184e46550dc8
rhg: replace command structs with functions
The `Command` trait was not used in any generic context,
and the struct where nothing more than holders for values parsed from CLI
arguments to be available to a `run` method.
Differential Revision: https://phab.mercurial-scm.org/D9967
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 08 Feb 2021 20:33:04 +0100 |
parents | a6e4e4650bac |
children |
line wrap: on
line diff
--- a/rust/rhg/src/commands.rs Mon Feb 08 11:13:56 2021 +0100 +++ b/rust/rhg/src/commands.rs Mon Feb 08 20:33:04 2021 +0100 @@ -3,13 +3,3 @@ pub mod debugrequirements; pub mod files; pub mod root; -use crate::error::CommandError; -use crate::ui::Ui; -use hg::config::Config; - -/// The common trait for rhg commands -/// -/// Normalize the interface of the commands provided by rhg -pub trait Command { - fn run(&self, ui: &Ui, config: &Config) -> Result<(), CommandError>; -}