1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
pub mod github_actions;
pub mod nothing;
pub mod syntax_highlight;

pub use nothing::*;
pub use std::ffi::OsStr;
pub use syntax_highlight::*;

pub trait Formatter {
    fn fmt(&self, program: impl AsRef<OsStr>, arguments: &[impl AsRef<OsStr>]) -> String;
}

pub trait Logger {
    fn log(&self, program: impl AsRef<OsStr>, arguments: &[impl AsRef<OsStr>]);
}

impl<Fmt: Formatter> Logger for Fmt {
    fn log(&self, program: impl AsRef<OsStr>, arguments: &[impl AsRef<OsStr>]) {
        println!("{}", self.fmt(program, arguments));
    }
}