@@ -20,7 +20,7 @@ pub(crate) struct PrettyFormatter<T> {
20
20
}
21
21
22
22
impl < T : Write > PrettyFormatter < T > {
23
- pub fn new (
23
+ pub ( crate ) fn new (
24
24
out : OutputLocation < T > ,
25
25
use_color : bool ,
26
26
max_name_len : usize ,
@@ -31,43 +31,43 @@ impl<T: Write> PrettyFormatter<T> {
31
31
}
32
32
33
33
#[ cfg( test) ]
34
- pub fn output_location ( & self ) -> & OutputLocation < T > {
34
+ pub ( crate ) fn output_location ( & self ) -> & OutputLocation < T > {
35
35
& self . out
36
36
}
37
37
38
- pub fn write_ok ( & mut self ) -> io:: Result < ( ) > {
38
+ pub ( crate ) fn write_ok ( & mut self ) -> io:: Result < ( ) > {
39
39
self . write_short_result ( "ok" , term:: color:: GREEN )
40
40
}
41
41
42
- pub fn write_failed ( & mut self ) -> io:: Result < ( ) > {
42
+ pub ( crate ) fn write_failed ( & mut self ) -> io:: Result < ( ) > {
43
43
self . write_short_result ( "FAILED" , term:: color:: RED )
44
44
}
45
45
46
- pub fn write_ignored ( & mut self , message : Option < & ' static str > ) -> io:: Result < ( ) > {
46
+ pub ( crate ) fn write_ignored ( & mut self , message : Option < & ' static str > ) -> io:: Result < ( ) > {
47
47
if let Some ( message) = message {
48
48
self . write_short_result ( & format ! ( "ignored, {message}" ) , term:: color:: YELLOW )
49
49
} else {
50
50
self . write_short_result ( "ignored" , term:: color:: YELLOW )
51
51
}
52
52
}
53
53
54
- pub fn write_time_failed ( & mut self ) -> io:: Result < ( ) > {
54
+ pub ( crate ) fn write_time_failed ( & mut self ) -> io:: Result < ( ) > {
55
55
self . write_short_result ( "FAILED (time limit exceeded)" , term:: color:: RED )
56
56
}
57
57
58
- pub fn write_bench ( & mut self ) -> io:: Result < ( ) > {
58
+ pub ( crate ) fn write_bench ( & mut self ) -> io:: Result < ( ) > {
59
59
self . write_pretty ( "bench" , term:: color:: CYAN )
60
60
}
61
61
62
- pub fn write_short_result (
62
+ pub ( crate ) fn write_short_result (
63
63
& mut self ,
64
64
result : & str ,
65
65
color : term:: color:: Color ,
66
66
) -> io:: Result < ( ) > {
67
67
self . write_pretty ( result, color)
68
68
}
69
69
70
- pub fn write_pretty ( & mut self , word : & str , color : term:: color:: Color ) -> io:: Result < ( ) > {
70
+ pub ( crate ) fn write_pretty ( & mut self , word : & str , color : term:: color:: Color ) -> io:: Result < ( ) > {
71
71
match self . out {
72
72
OutputLocation :: Pretty ( ref mut term) => {
73
73
if self . use_color {
@@ -86,7 +86,7 @@ impl<T: Write> PrettyFormatter<T> {
86
86
}
87
87
}
88
88
89
- pub fn write_plain < S : AsRef < str > > ( & mut self , s : S ) -> io:: Result < ( ) > {
89
+ pub ( crate ) fn write_plain < S : AsRef < str > > ( & mut self , s : S ) -> io:: Result < ( ) > {
90
90
let s = s. as_ref ( ) ;
91
91
self . out . write_all ( s. as_bytes ( ) ) ?;
92
92
self . out . flush ( )
@@ -154,15 +154,15 @@ impl<T: Write> PrettyFormatter<T> {
154
154
Ok ( ( ) )
155
155
}
156
156
157
- pub fn write_successes ( & mut self , state : & ConsoleTestState ) -> io:: Result < ( ) > {
157
+ pub ( crate ) fn write_successes ( & mut self , state : & ConsoleTestState ) -> io:: Result < ( ) > {
158
158
self . write_results ( & state. not_failures , "successes" )
159
159
}
160
160
161
- pub fn write_failures ( & mut self , state : & ConsoleTestState ) -> io:: Result < ( ) > {
161
+ pub ( crate ) fn write_failures ( & mut self , state : & ConsoleTestState ) -> io:: Result < ( ) > {
162
162
self . write_results ( & state. failures , "failures" )
163
163
}
164
164
165
- pub fn write_time_failures ( & mut self , state : & ConsoleTestState ) -> io:: Result < ( ) > {
165
+ pub ( crate ) fn write_time_failures ( & mut self , state : & ConsoleTestState ) -> io:: Result < ( ) > {
166
166
self . write_results ( & state. time_failures , "failures (time limit exceeded)" )
167
167
}
168
168
0 commit comments