cli/terminal: remove unused trait
This commit is contained in:
parent
d41ac59828
commit
1f80eb61ed
|
|
@ -36,21 +36,6 @@ impl Context for Profile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A command that can be run.
|
|
||||||
pub trait Command<A: Args, C: Context> {
|
|
||||||
/// Run the command, given arguments and a context.
|
|
||||||
fn run(self, args: A, context: C) -> anyhow::Result<()>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<F, A: Args, C: Context> Command<A, C> for F
|
|
||||||
where
|
|
||||||
F: FnOnce(A, C) -> anyhow::Result<()>,
|
|
||||||
{
|
|
||||||
fn run(self, args: A, context: C) -> anyhow::Result<()> {
|
|
||||||
self(args, context)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Execute a function `cmd` that runs a command with parsed the `args`
|
/// Execute a function `cmd` that runs a command with parsed the `args`
|
||||||
/// and a default context.
|
/// and a default context.
|
||||||
pub fn run_command_fn<F, P: Parser, C>(cmd: F, args: P, ctx: C) -> !
|
pub fn run_command_fn<F, P: Parser, C>(cmd: F, args: P, ctx: C) -> !
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue