@@ -71,19 +71,19 @@ impl Formatter {
7171
7272pub ( in crate :: fmt:: writer) struct BufferWriter {
7373 inner : termcolor:: BufferWriter ,
74- test_target : Option < WritableTarget > ,
74+ uncolored_target : Option < WritableTarget > ,
7575}
7676
7777pub ( in crate :: fmt) struct Buffer {
7878 inner : termcolor:: Buffer ,
79- has_test_target : bool ,
79+ has_uncolored_target : bool ,
8080}
8181
8282impl BufferWriter {
8383 pub ( in crate :: fmt:: writer) fn stderr ( is_test : bool , write_style : WriteStyle ) -> Self {
8484 BufferWriter {
8585 inner : termcolor:: BufferWriter :: stderr ( write_style. into_color_choice ( ) ) ,
86- test_target : if is_test {
86+ uncolored_target : if is_test {
8787 Some ( WritableTarget :: Stderr )
8888 } else {
8989 None
@@ -94,7 +94,7 @@ impl BufferWriter {
9494 pub ( in crate :: fmt:: writer) fn stdout ( is_test : bool , write_style : WriteStyle ) -> Self {
9595 BufferWriter {
9696 inner : termcolor:: BufferWriter :: stdout ( write_style. into_color_choice ( ) ) ,
97- test_target : if is_test {
97+ uncolored_target : if is_test {
9898 Some ( WritableTarget :: Stdout )
9999 } else {
100100 None
@@ -110,23 +110,19 @@ impl BufferWriter {
110110 BufferWriter {
111111 // The inner Buffer is never printed from, but it is still needed to handle coloring and other formating
112112 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- } ,
113+ uncolored_target : Some ( WritableTarget :: Pipe ( pipe) )
118114 }
119115 }
120116
121117 pub ( in crate :: fmt:: writer) fn buffer ( & self ) -> Buffer {
122118 Buffer {
123119 inner : self . inner . buffer ( ) ,
124- has_test_target : self . test_target . is_some ( ) ,
120+ has_uncolored_target : self . uncolored_target . is_some ( ) ,
125121 }
126122 }
127123
128124 pub ( in crate :: fmt:: writer) fn print ( & self , buf : & Buffer ) -> io:: Result < ( ) > {
129- if let Some ( target) = & self . test_target {
125+ if let Some ( target) = & self . uncolored_target {
130126 // This impl uses the `eprint` and `print` macros
131127 // instead of `termcolor`'s buffer.
132128 // This is so their output can be captured by `cargo test`
@@ -164,7 +160,7 @@ impl Buffer {
164160
165161 fn set_color ( & mut self , spec : & ColorSpec ) -> io:: Result < ( ) > {
166162 // Ignore styles for test captured logs because they can't be printed
167- if !self . has_test_target {
163+ if !self . has_uncolored_target {
168164 self . inner . set_color ( spec)
169165 } else {
170166 Ok ( ( ) )
@@ -173,7 +169,7 @@ impl Buffer {
173169
174170 fn reset ( & mut self ) -> io:: Result < ( ) > {
175171 // Ignore styles for test captured logs because they can't be printed
176- if !self . has_test_target {
172+ if !self . has_uncolored_target {
177173 self . inner . reset ( )
178174 } else {
179175 Ok ( ( ) )
0 commit comments