Impl Debug for CreateHook

This commit is contained in:
Matthias Beyer 2016-07-16 16:26:01 +02:00
parent a8ea51460c
commit e19121f43a
1 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,5 @@
use std::path::PathBuf;
use std::fmt::{Debug, Formatter, Error as FmtError};
use toml::Value;
@ -9,7 +10,6 @@ use libimagstore::hook::position::HookPosition;
use libimagstore::hook::accessor::{HookDataAccessor, HookDataAccessorProvider};
use libimagstore::hook::accessor::StoreIdAccessor;
#[derive(Debug)]
pub struct CreateHook<'a> {
storepath: &'a PathBuf,
@ -29,6 +29,17 @@ impl<'a> CreateHook<'a> {
}
impl<'a> Debug for CreateHook<'a> {
fn fmt(&self, fmt: &mut Formatter) -> Result<(), FmtError> {
write!(fmt, "CreateHook(storepath={:?}, repository={}, pos={:?}, cfg={:?}",
self.storepath,
(if self.repository.is_some() { "Some(_)" } else { "None" }),
self.position,
self.config)
}
}
impl<'a> Hook for CreateHook<'a> {
fn name(&self) -> &'static str {