From fc42d6b4bf3660fad3c081c499f0303241bb449f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 28 Dec 2015 13:56:01 +0100 Subject: [PATCH] FilePrinter: Add print_file_custom(), print_files_custom() --- src/ui/file.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ui/file.rs b/src/ui/file.rs index b99726f4..6c9eaf0d 100644 --- a/src/ui/file.rs +++ b/src/ui/file.rs @@ -23,6 +23,21 @@ pub trait FilePrinter { } } + fn print_file_custom(&self, file: Rc>, f: &F) + where F: Fn(Rc>) -> String + { + info!("{}", f(file)); + } + + fn print_files_custom(&self, files: I, f: &F) + where I: Iterator>>, + F: Fn(Rc>) -> String + { + for file in files { + self.print_file_custom(file, f); + } + } + } struct DebugPrinter {