@@ -71,19 +71,19 @@ impl Formatter {
71
71
72
72
pub ( in crate :: fmt:: writer) struct BufferWriter {
73
73
inner : termcolor:: BufferWriter ,
74
- test_target : Option < WritableTarget > ,
74
+ uncolored_target : Option < WritableTarget > ,
75
75
}
76
76
77
77
pub ( in crate :: fmt) struct Buffer {
78
78
inner : termcolor:: Buffer ,
79
- has_test_target : bool ,
79
+ has_uncolored_target : bool ,
80
80
}
81
81
82
82
impl BufferWriter {
83
83
pub ( in crate :: fmt:: writer) fn stderr ( is_test : bool , write_style : WriteStyle ) -> Self {
84
84
BufferWriter {
85
85
inner : termcolor:: BufferWriter :: stderr ( write_style. into_color_choice ( ) ) ,
86
- test_target : if is_test {
86
+ uncolored_target : if is_test {
87
87
Some ( WritableTarget :: Stderr )
88
88
} else {
89
89
None
@@ -94,7 +94,7 @@ impl BufferWriter {
94
94
pub ( in crate :: fmt:: writer) fn stdout ( is_test : bool , write_style : WriteStyle ) -> Self {
95
95
BufferWriter {
96
96
inner : termcolor:: BufferWriter :: stdout ( write_style. into_color_choice ( ) ) ,
97
- test_target : if is_test {
97
+ uncolored_target : if is_test {
98
98
Some ( WritableTarget :: Stdout )
99
99
} else {
100
100
None
@@ -103,30 +103,25 @@ impl BufferWriter {
103
103
}
104
104
105
105
pub ( in crate :: fmt:: writer) fn pipe (
106
- is_test : bool ,
107
106
write_style : WriteStyle ,
108
107
pipe : Box < Mutex < dyn io:: Write + Send + ' static > > ,
109
108
) -> Self {
110
109
BufferWriter {
111
110
// The inner Buffer is never printed from, but it is still needed to handle coloring and other formating
112
111
inner : termcolor:: BufferWriter :: stderr ( write_style. into_color_choice ( ) ) ,
113
- test_target : if is_test {
114
- Some ( WritableTarget :: Pipe ( pipe) )
115
- } else {
116
- None
117
- } ,
112
+ uncolored_target : Some ( WritableTarget :: Pipe ( pipe) ) ,
118
113
}
119
114
}
120
115
121
116
pub ( in crate :: fmt:: writer) fn buffer ( & self ) -> Buffer {
122
117
Buffer {
123
118
inner : self . inner . buffer ( ) ,
124
- has_test_target : self . test_target . is_some ( ) ,
119
+ has_uncolored_target : self . uncolored_target . is_some ( ) ,
125
120
}
126
121
}
127
122
128
123
pub ( in crate :: fmt:: writer) fn print ( & self , buf : & Buffer ) -> io:: Result < ( ) > {
129
- if let Some ( target) = & self . test_target {
124
+ if let Some ( target) = & self . uncolored_target {
130
125
// This impl uses the `eprint` and `print` macros
131
126
// instead of `termcolor`'s buffer.
132
127
// This is so their output can be captured by `cargo test`
@@ -164,7 +159,7 @@ impl Buffer {
164
159
165
160
fn set_color ( & mut self , spec : & ColorSpec ) -> io:: Result < ( ) > {
166
161
// Ignore styles for test captured logs because they can't be printed
167
- if !self . has_test_target {
162
+ if !self . has_uncolored_target {
168
163
self . inner . set_color ( spec)
169
164
} else {
170
165
Ok ( ( ) )
@@ -173,7 +168,7 @@ impl Buffer {
173
168
174
169
fn reset ( & mut self ) -> io:: Result < ( ) > {
175
170
// Ignore styles for test captured logs because they can't be printed
176
- if !self . has_test_target {
171
+ if !self . has_uncolored_target {
177
172
self . inner . reset ( )
178
173
} else {
179
174
Ok ( ( ) )
0 commit comments