/// A function which will print a given &str `s` in accordance to the StylOpt `opt`.
A function which will print a given &str `s` in accordance to the StylOpt `opt`.
A function which will print a given &str ` s ` in accordance to the StylOpt ` opt ` .
pub fn stylize(s: &str, opt: &StyleOpt) -> String {
    format!("{fg}{bg}{sgr}{text}{reset}",
        fg = match opt.fg.as_ref() {
            None => "",
            Some(fg) => fg.escape_code(),
        },
        bg = match opt.bg.as_ref() {
            None => "",
            Some(bg) => bg.escape_code(),
        },
        sgr = match opt.sgr.as_ref() {
            None => "",
            Some(sgr) => sgr.escape_code(),
        },
        text = s,
        // Note: Using Fg::Reset vs. Bg::Reset makes no difference 
        reset = Fg::Reset.escape_code(),
    )
}
pub fn stylize ( s : & str , opt : & StyleOpt ) -> String { format ! ( " " fg match opt fg as_ref ( ) { None " " Some ( fg ) fg escape_code ( ) } bg match opt bg as_ref ( ) { None " " Some ( bg ) bg escape_code ( ) } sgr match opt sgr as_ref ( ) { None " " Some ( sgr ) sgr escape_code ( ) } text s // Note: Using Fg::Reset vs. Bg::Reset makes no difference  reset Fg Reset escape_code ( ) ) }
A function which will print a given &str `s` in accordance to the StylOpt `opt`.
A function which will print a given &str ` s ` in accordance to the StylOpt ` opt ` .
s
&str
opt
&StyleOpt