Impl FilePrinter for SimplePrinter ::print_file_custom()

This commit is contained in:
Matthias Beyer 2015-12-28 13:56:38 +01:00
parent f0c186f33b
commit 6455c45630

View file

@ -92,6 +92,19 @@ impl FilePrinter for SimplePrinter {
}
}
fn print_file_custom<F>(&self, file: Rc<RefCell<File>>, f: &F)
where F: Fn(Rc<RefCell<File>>) -> String
{
let s = f(file);
if self.debug {
debug!("{:?}", s);
} else if self.verbose {
info!("{}", s);
} else {
info!("[File]: {}", s);
}
}
}
pub struct TablePrinter {