@@ -4,13 +4,13 @@ mod std_in;
4
4
pub ( crate ) mod traverse;
5
5
6
6
use crate :: cli_options:: { CliOptions , CliReporter } ;
7
- use crate :: execute:: traverse:: { traverse , TraverseResult } ;
7
+ use crate :: execute:: traverse:: { TraverseResult , traverse } ;
8
8
use crate :: reporter:: github:: { GithubReporter , GithubReporterVisitor } ;
9
9
use crate :: reporter:: gitlab:: { GitLabReporter , GitLabReporterVisitor } ;
10
10
use crate :: reporter:: junit:: { JunitReporter , JunitReporterVisitor } ;
11
11
use crate :: reporter:: terminal:: { ConsoleReporter , ConsoleReporterVisitor } ;
12
12
use crate :: { CliDiagnostic , CliSession , DiagnosticsPayload , Reporter } ;
13
- use pglt_diagnostics:: { category , Category } ;
13
+ use pglt_diagnostics:: { Category , category } ;
14
14
use pglt_fs:: PgLTPath ;
15
15
use std:: borrow:: Borrow ;
16
16
use std:: ffi:: OsString ;
@@ -103,7 +103,7 @@ pub enum TraversalMode {
103
103
impl Display for TraversalMode {
104
104
fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
105
105
match self {
106
- TraversalMode :: Dummy { .. } => write ! ( f, "dummy" ) ,
106
+ TraversalMode :: Dummy => write ! ( f, "dummy" ) ,
107
107
TraversalMode :: Check { .. } => write ! ( f, "check" ) ,
108
108
}
109
109
}
@@ -165,33 +165,33 @@ impl Execution {
165
165
166
166
pub ( crate ) fn as_diagnostic_category ( & self ) -> & ' static Category {
167
167
match self . traversal_mode {
168
- TraversalMode :: Dummy { .. } => category ! ( "dummy" ) ,
168
+ TraversalMode :: Dummy => category ! ( "dummy" ) ,
169
169
TraversalMode :: Check { .. } => category ! ( "check" ) ,
170
170
}
171
171
}
172
172
173
173
pub ( crate ) const fn is_dummy ( & self ) -> bool {
174
- matches ! ( self . traversal_mode, TraversalMode :: Dummy { .. } )
174
+ matches ! ( self . traversal_mode, TraversalMode :: Dummy )
175
175
}
176
176
177
177
/// Whether the traversal mode requires write access to files
178
178
pub ( crate ) const fn requires_write_access ( & self ) -> bool {
179
179
match self . traversal_mode {
180
- TraversalMode :: Dummy { .. } => false ,
180
+ TraversalMode :: Dummy => false ,
181
181
TraversalMode :: Check { .. } => false ,
182
182
}
183
183
}
184
184
185
185
pub ( crate ) fn as_stdin_file ( & self ) -> Option < & Stdin > {
186
186
match & self . traversal_mode {
187
- TraversalMode :: Dummy { .. } => None ,
187
+ TraversalMode :: Dummy => None ,
188
188
TraversalMode :: Check { stdin, .. } => stdin. as_ref ( ) ,
189
189
}
190
190
}
191
191
192
192
pub ( crate ) fn is_vcs_targeted ( & self ) -> bool {
193
193
match & self . traversal_mode {
194
- TraversalMode :: Dummy { .. } => false ,
194
+ TraversalMode :: Dummy => false ,
195
195
TraversalMode :: Check { vcs_targeted, .. } => {
196
196
vcs_targeted. staged || vcs_targeted. changed
197
197
}
@@ -205,7 +205,7 @@ impl Execution {
205
205
/// Returns [true] if the user used the `--write`/`--fix` option
206
206
pub ( crate ) fn is_write ( & self ) -> bool {
207
207
match self . traversal_mode {
208
- TraversalMode :: Dummy { .. } => false ,
208
+ TraversalMode :: Dummy => false ,
209
209
TraversalMode :: Check { .. } => false ,
210
210
}
211
211
}
@@ -223,7 +223,10 @@ pub fn execute_mode(
223
223
execution. max_diagnostics = if cli_options. reporter . is_default ( ) {
224
224
cli_options. max_diagnostics . into ( )
225
225
} else {
226
- info ! ( "Removing the limit of --max-diagnostics, because of a reporter different from the default one: {}" , cli_options. reporter) ;
226
+ info ! (
227
+ "Removing the limit of --max-diagnostics, because of a reporter different from the default one: {}" ,
228
+ cli_options. reporter
229
+ ) ;
227
230
u32:: MAX
228
231
} ;
229
232
0 commit comments