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

View file

@ -1,8 +1,24 @@
use std::fmt::{Display, Formatter, Error};
#[derive(Clone, Debug)]
pub enum StoreAction { pub enum StoreAction {
Create, Create,
Retrieve, Retrieve,
Update, Update,
Delete, 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",
})
}
}