From 6455c45630c97f5a1ae446c6ba4405b541afb094 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 28 Dec 2015 13:56:38 +0100 Subject: [PATCH] Impl FilePrinter for SimplePrinter ::print_file_custom() --- src/ui/file.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ui/file.rs b/src/ui/file.rs index 43c46231..e9ab2e38 100644 --- a/src/ui/file.rs +++ b/src/ui/file.rs @@ -92,6 +92,19 @@ impl FilePrinter for SimplePrinter { } } + fn print_file_custom(&self, file: Rc>, f: &F) + where F: Fn(Rc>) -> String + { + let s = f(file); + if self.debug { + debug!("{:?}", s); + } else if self.verbose { + info!("{}", s); + } else { + info!("[File]: {}", s); + } + } + } pub struct TablePrinter {