Extract most shared logic into SimplePrinter

This should hopefully allow for more command line options, like no
color, omitting line number and file names for better scriptability.
This commit is contained in:
Cameron Cordes
2020-05-19 23:23:15 -04:00
parent 263dad91da
commit ee3e61b76d
2 changed files with 84 additions and 27 deletions

View File

@@ -9,8 +9,11 @@ pub struct FileMatch {
impl FileMatch {
pub fn print(&self, config: &Config) {
let cp = ColorPrinter {};
cp.print(&config, &self);
let cp = ColorPrinter {
config: config,
file_match: self,
};
cp.print();
}
}