diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-07-15 22:29:28 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-09-07 22:05:12 +0200 |
commit | 61c3519d452d9f6787cb6ad3d444b0eb8bb09769 (patch) | |
tree | 4a4220d8c0a0fe6ed2e12ea7fb4424bb4c1acfd5 /libimagstorestdhook/src/vcs/git/action.rs | |
parent | d03b13be1083a167c2e4bd9ae809db04031e3c5b (diff) |
Impl Debug, Clone, Display for StoreAction
Diffstat (limited to 'libimagstorestdhook/src/vcs/git/action.rs')
-rw-r--r-- | libimagstorestdhook/src/vcs/git/action.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libimagstorestdhook/src/vcs/git/action.rs b/libimagstorestdhook/src/vcs/git/action.rs index 45cbf0da..26caf5a0 100644 --- a/libimagstorestdhook/src/vcs/git/action.rs +++ b/libimagstorestdhook/src/vcs/git/action.rs @@ -1,8 +1,24 @@ +use std::fmt::{Display, Formatter, Error}; + +#[derive(Clone, Debug)] pub enum StoreAction { Create, Retrieve, Update, Delete, +} + +impl Display for StoreAction { + + fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> { + write!(fmt, "StoreAction: {}", + match *self { + StoreAction::Create => "create", + StoreAction::Retrieve => "retrieve", + StoreAction::Update => "update", + StoreAction::Delete => "delete", + }) + } - // "Read" doesn't matter, as we do not use git on read actions, only when altering content. } + |