Impl Debug, Clone, Display for StoreAction

This commit is contained in:
Matthias Beyer 2016-07-15 22:29:28 +02:00
parent d03b13be10
commit 61c3519d45
1 changed files with 18 additions and 2 deletions

View File

@ -1,8 +1,24 @@
use std::fmt::{Display, Formatter, Error};
#[derive(Clone, Debug)]
pub enum StoreAction {
Create,
Retrieve,
Update,
Delete,
// "Read" doesn't matter, as we do not use git on read actions, only when altering content.
}
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",
})
}
}