1
1
use super :: utils:: * ;
2
2
use std:: borrow:: Cow ;
3
3
use std:: io:: { Stderr , Write } ;
4
- use std:: sync:: atomic:: { AtomicBool , AtomicUsize } ;
4
+ use std:: sync:: atomic:: AtomicUsize ;
5
5
6
6
use anstyle:: { AnsiColor , Effects , Style } ;
7
7
use itertools:: enumerate;
@@ -24,8 +24,6 @@ pub trait Formatter: Send + Sync {
24
24
25
25
fn dispatch_file_violations ( & self , linted_file : & LintedFile , only_fixable : bool ) ;
26
26
27
- fn has_fail ( & self ) -> bool ;
28
-
29
27
fn completion_message ( & self ) ;
30
28
}
31
29
@@ -35,7 +33,6 @@ pub struct OutputStreamFormatter {
35
33
filter_empty : bool ,
36
34
verbosity : i32 ,
37
35
output_line_length : usize ,
38
- pub has_fail : AtomicBool ,
39
36
files_dispatched : AtomicUsize ,
40
37
}
41
38
@@ -55,10 +52,6 @@ impl Formatter for OutputStreamFormatter {
55
52
. fetch_add ( 1 , std:: sync:: atomic:: Ordering :: SeqCst ) ;
56
53
}
57
54
58
- fn has_fail ( & self ) -> bool {
59
- self . has_fail . load ( std:: sync:: atomic:: Ordering :: SeqCst )
60
- }
61
-
62
55
fn completion_message ( & self ) {
63
56
let count = self
64
57
. files_dispatched
@@ -92,7 +85,6 @@ impl OutputStreamFormatter {
92
85
filter_empty : true ,
93
86
verbosity,
94
87
output_line_length : 80 ,
95
- has_fail : false . into ( ) ,
96
88
files_dispatched : 0 . into ( ) ,
97
89
}
98
90
}
@@ -146,11 +138,7 @@ impl OutputStreamFormatter {
146
138
147
139
let color = match status {
148
140
Status :: Pass | Status :: Fixed => AnsiColor :: Green ,
149
- Status :: Fail | Status :: Error => {
150
- self . has_fail
151
- . store ( true , std:: sync:: atomic:: Ordering :: SeqCst ) ;
152
- AnsiColor :: Red
153
- }
141
+ Status :: Fail | Status :: Error => AnsiColor :: Red ,
154
142
}
155
143
. on_default ( ) ;
156
144
0 commit comments