mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Allow for setting of write-mode via config file. FIxes #215
Also from @marcusklaas: Refactor code output functions Specifically, `write_all_files` no longer returns a HashMap. It would sometimes contain items, and sometimes be empty. When "fixed" newlines are required, this must now be done with a separate call. The tests use this strategy and should now pass!
This commit is contained in:
+3
-3
@@ -17,8 +17,8 @@
|
||||
extern crate env_logger;
|
||||
extern crate getopts;
|
||||
|
||||
use rustfmt::{WriteMode, run, run_from_stdin};
|
||||
use rustfmt::config::Config;
|
||||
use rustfmt::{run, run_from_stdin};
|
||||
use rustfmt::config::{Config, WriteMode};
|
||||
|
||||
use std::env;
|
||||
use std::fs::{self, File};
|
||||
@@ -216,7 +216,7 @@ fn determine_operation(matches: &Matches) -> Operation {
|
||||
Err(..) => return Operation::InvalidInput("Unrecognized write mode".into()),
|
||||
}
|
||||
}
|
||||
None => WriteMode::Replace,
|
||||
None => WriteMode::Default,
|
||||
};
|
||||
|
||||
let files: Vec<_> = matches.free.iter().map(PathBuf::from).collect();
|
||||
|
||||
Reference in New Issue
Block a user