Skip to content

Commit 5a60e31

Browse files
Default implementation of epilogue function
1 parent 46b5fe2 commit 5a60e31

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/color.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ use core::fmt;
33

44
pub trait Color {
55
fn prelude(&self, f: &mut fmt::Formatter, canvas: Canvas) -> fmt::Result;
6-
fn epilogue(&self, f: &mut fmt::Formatter, canvas: Canvas) -> fmt::Result;
6+
#[allow(unused)]
7+
fn epilogue(&self, f: &mut fmt::Formatter, canvas: Canvas) -> fmt::Result {
8+
write!(f, "\x1B[0m")
9+
}
710
}

src/colors.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ impl Color for RGB8 {
99
Canvas::Background => write!(f, "\x1B[48;2;{};{};{}m", self.r, self.g, self.b)
1010
}
1111
}
12-
fn epilogue(&self, f: &mut core::fmt::Formatter, _canvas: crate::Canvas) -> core::fmt::Result {
13-
write!(f, "\x1B[0m")
14-
}
1512
}
1613

1714
/// Makes <code style="color: black; background: #FFFFFF">white</code>

0 commit comments

Comments
 (0)