From bcf91780aaed3b7345e1ede3095c23200ac573b3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 7 Sep 2016 20:54:44 +0200 Subject: [PATCH] impl Debug for UpdateHook --- libimagstorestdhook/src/vcs/git/update.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libimagstorestdhook/src/vcs/git/update.rs b/libimagstorestdhook/src/vcs/git/update.rs index 388a1929..86cdb6d3 100644 --- a/libimagstorestdhook/src/vcs/git/update.rs +++ b/libimagstorestdhook/src/vcs/git/update.rs @@ -11,7 +11,6 @@ use libimagstore::hook::accessor::StoreIdAccessor; use vcs::git::runtime::Runtime as GRuntime; -#[derive(Debug)] pub struct UpdateHook { storepath: PathBuf, @@ -32,6 +31,16 @@ impl UpdateHook { } +impl Debug for UpdateHook { + fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FmtError> { + write!(fmt, "UpdateHook(storepath={:?}, repository={}, pos={:?}, cfg={:?}", + self.storepath, + (if self.runtime.has_repository() { "Some(_)" } else { "None" }), + self.position, + self.runtime.has_config()) + } +} + impl Hook for UpdateHook { fn name(&self) -> &'static str {