@@ -17,16 +17,16 @@ pub struct Renderer {
1717
1818impl Renderer {
1919 /// No terminal styling
20- pub fn plain ( ) -> Self {
20+ pub const fn plain ( ) -> Self {
2121 Self {
2222 anonymized_line_numbers : false ,
2323 margin : None ,
24- stylesheet : Stylesheet :: default ( ) ,
24+ stylesheet : Stylesheet :: plain ( ) ,
2525 }
2626 }
2727
2828 /// Default terminal styling
29- pub fn styled ( ) -> Self {
29+ pub const fn styled ( ) -> Self {
3030 Self {
3131 stylesheet : Stylesheet {
3232 error : AnsiColor :: BrightRed . on_default ( ) . effects ( Effects :: BOLD ) ,
@@ -42,52 +42,52 @@ impl Renderer {
4242 }
4343 }
4444
45- pub fn anonymized_line_numbers ( mut self , anonymized_line_numbers : bool ) -> Self {
45+ pub const fn anonymized_line_numbers ( mut self , anonymized_line_numbers : bool ) -> Self {
4646 self . anonymized_line_numbers = anonymized_line_numbers;
4747 self
4848 }
4949
50- pub fn margin ( mut self , margin : Option < Margin > ) -> Self {
50+ pub const fn margin ( mut self , margin : Option < Margin > ) -> Self {
5151 self . margin = margin;
5252 self
5353 }
5454
55- pub fn error ( mut self , style : Style ) -> Self {
55+ pub const fn error ( mut self , style : Style ) -> Self {
5656 self . stylesheet . error = style;
5757 self
5858 }
5959
60- pub fn warning ( mut self , style : Style ) -> Self {
60+ pub const fn warning ( mut self , style : Style ) -> Self {
6161 self . stylesheet . warning = style;
6262 self
6363 }
6464
65- pub fn info ( mut self , style : Style ) -> Self {
65+ pub const fn info ( mut self , style : Style ) -> Self {
6666 self . stylesheet . info = style;
6767 self
6868 }
6969
70- pub fn note ( mut self , style : Style ) -> Self {
70+ pub const fn note ( mut self , style : Style ) -> Self {
7171 self . stylesheet . note = style;
7272 self
7373 }
7474
75- pub fn help ( mut self , style : Style ) -> Self {
75+ pub const fn help ( mut self , style : Style ) -> Self {
7676 self . stylesheet . help = style;
7777 self
7878 }
7979
80- pub fn line_no ( mut self , style : Style ) -> Self {
80+ pub const fn line_no ( mut self , style : Style ) -> Self {
8181 self . stylesheet . line_no = style;
8282 self
8383 }
8484
85- pub fn emphasis ( mut self , style : Style ) -> Self {
85+ pub const fn emphasis ( mut self , style : Style ) -> Self {
8686 self . stylesheet . emphasis = style;
8787 self
8888 }
8989
90- pub fn none ( mut self , style : Style ) -> Self {
90+ pub const fn none ( mut self , style : Style ) -> Self {
9191 self . stylesheet . none = style;
9292 self
9393 }
0 commit comments