diff options
author | Canop <cano.petrole@gmail.com> | 2020-09-29 16:56:46 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-09-29 16:56:46 +0200 |
commit | c0b0b283dc2b24c3469339ebf61c28fda1e0efbb (patch) | |
tree | ca0dd838237e7a46e660d94f3f918fac4417ace5 /src/verb/verb_execution.rs | |
parent | 46316405917f92e622cdb6e0b29dd769afb65206 (diff) |
refactor verb initialization from conf
removing the useless step of VerbConf and VerbConfExecutionType
Diffstat (limited to 'src/verb/verb_execution.rs')
-rw-r--r-- | src/verb/verb_execution.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/verb/verb_execution.rs b/src/verb/verb_execution.rs index 6390598..0a950b8 100644 --- a/src/verb/verb_execution.rs +++ b/src/verb/verb_execution.rs @@ -1,4 +1,7 @@ -use super::*; +use { + super::*, + std::fmt, +}; /// how a verb must be executed #[derive(Debug, Clone)] @@ -15,3 +18,14 @@ pub enum VerbExecution { /// to broot with --cmd Sequence(SequenceExecution), } + +impl fmt::Display for VerbExecution { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Internal(ie) => ie.fmt(f), + Self::External(ee) => ee.exec_pattern.fmt(f), + Self::Sequence(se) => se.sequence.raw.fmt(f), + } + } +} + |