fn write_with_style(&mut self, c: &char, style: Style) -> fmt::Result {
        // If the style is the same as previously, just write character
        if style == self.style {
            write!(self.f, "{}", c)?;
        } else {
            // Close out previous style
            write!(self.f, "{}", self.style.suffix())?;

            // Store new style and start writing it
            write!(self.f, "{}{}", style.prefix(), c)?;
            self.style = style;
        }
        Ok(())
    }
/// Push a new character into the buffer, specifying the style it should be written in.
Push a new character into the buffer, specifying the style it should be written in.
Push a new character into the buffer specifying the style it should be written in .
fn write_with_style(&mut self, c: &char, style: Style) -> fmt::Result {
        // If the style is the same as previously, just write character
        if style == self.style {
            write!(self.f, "{}", c)?;
        } else {
            // Close out previous style
            write!(self.f, "{}", self.style.suffix())?;
            // Store new style and start writing it
            write!(self.f, "{}{}", style.prefix(), c)?;
            self.style = style;
        }
        Ok(())
    }
fn write_with_style ( & mut self , c : & char , style : Style ) -> fmt :: Result { // If the style is the same as previously, just write character if style == self . style { write ! ( self f " " c ) ? ; } else { // Close out previous style write ! ( self f " " self style suffix ( ) ) ? ; // Store new style and start writing it write ! ( self f " " style prefix ( ) c ) ? ; self . style = style ; } Ok ( ( ) ) }
Push a new character into the buffer, specifying the style it should be written in.
Push a new character into the buffer specifying the style it should be written in .
&mut self
c
&char
style
Style
&mut self
c
&char
style
Style