@@ -285,33 +285,11 @@ fn fmt_lines(changes: &mut ChangeSet, config: &Config) -> FormatReport {
285
285
}
286
286
287
287
struct RustFmtCalls {
288
- input_path : Option < PathBuf > ,
289
288
write_mode : WriteMode ,
290
289
config : Option < Box < config:: Config > > ,
291
290
}
292
291
293
292
impl < ' a > CompilerCalls < ' a > for RustFmtCalls {
294
- fn early_callback ( & mut self ,
295
- _: & getopts:: Matches ,
296
- _: & diagnostics:: registry:: Registry )
297
- -> Compilation {
298
- Compilation :: Continue
299
- }
300
-
301
- fn some_input ( & mut self ,
302
- input : Input ,
303
- input_path : Option < PathBuf > )
304
- -> ( Input , Option < PathBuf > ) {
305
- match input_path {
306
- Some ( ref ip) => self . input_path = Some ( ip. clone ( ) ) ,
307
- _ => {
308
- // FIXME should handle string input and write to stdout or something
309
- panic ! ( "No input path" ) ;
310
- }
311
- }
312
- ( input, input_path)
313
- }
314
-
315
293
fn no_input ( & mut self ,
316
294
_: & getopts:: Matches ,
317
295
_: & rustc_config:: Options ,
@@ -322,16 +300,6 @@ impl<'a> CompilerCalls<'a> for RustFmtCalls {
322
300
panic ! ( "No input supplied to RustFmt" ) ;
323
301
}
324
302
325
- fn late_callback ( & mut self ,
326
- _: & getopts:: Matches ,
327
- _: & Session ,
328
- _: & Input ,
329
- _: & Option < PathBuf > ,
330
- _: & Option < PathBuf > )
331
- -> Compilation {
332
- Compilation :: Continue
333
- }
334
-
335
303
fn build_controller ( & mut self , _: & Session ) -> driver:: CompileController < ' a > {
336
304
let write_mode = self . write_mode ;
337
305
@@ -373,6 +341,6 @@ impl<'a> CompilerCalls<'a> for RustFmtCalls {
373
341
// default_config is a string of toml data to be used to configure rustfmt.
374
342
pub fn run ( args : Vec < String > , write_mode : WriteMode , default_config : & str ) {
375
343
let config = Some ( Box :: new ( config:: Config :: from_toml ( default_config) ) ) ;
376
- let mut call_ctxt = RustFmtCalls { input_path : None , write_mode : write_mode, config : config } ;
344
+ let mut call_ctxt = RustFmtCalls { write_mode : write_mode, config : config } ;
377
345
rustc_driver:: run_compiler ( & args, & mut call_ctxt) ;
378
346
}
0 commit comments