From 47646d608b1f99ecbac586241e6fdae191bf2c97 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 17 Sep 2016 17:23:34 +0200 Subject: [PATCH] Impl Debug for DeleteHook --- libimagstorestdhook/src/vcs/git/delete.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libimagstorestdhook/src/vcs/git/delete.rs b/libimagstorestdhook/src/vcs/git/delete.rs index ccb38b4f..e176a3db 100644 --- a/libimagstorestdhook/src/vcs/git/delete.rs +++ b/libimagstorestdhook/src/vcs/git/delete.rs @@ -13,7 +13,6 @@ use vcs::git::error::GitHookErrorKind as GHEK; use vcs::git::error::MapErrInto; use vcs::git::runtime::Runtime as GRuntime; -#[derive(Debug)] pub struct DeleteHook { storepath: PathBuf, @@ -34,6 +33,17 @@ impl DeleteHook { } +impl Debug for DeleteHook { + fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FmtError> { + write!(fmt, "DeleteHook(storepath={:?}, repository={}, pos={:?}, cfg={:?})", + self.storepath, + (if self.runtime.has_repository() { "Some(_)" } else { "None" }), + self.position, + self.runtime.has_config()) + } +} + + impl Hook for DeleteHook { fn name(&self) -> &'static str {