diff options
| author | Victor M. Suarez <svmnotn@gmail.com> | 2016-01-12 18:12:48 -0500 |
|---|---|---|
| committer | Victor M. Suarez <svmnotn@gmail.com> | 2016-01-12 18:12:48 -0500 |
| commit | 4f8938c616af167e47a05abafdfa67eed5f13533 (patch) | |
| tree | 994b148dd6b731f42e1b93042656de361395a290 /src/bin/rustfmt.rs | |
| parent | ba465e0fc2b2203f7ebbdd50be7400ae43389467 (diff) | |
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!
Diffstat (limited to 'src/bin/rustfmt.rs')
| -rw-r--r-- | src/bin/rustfmt.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/rustfmt.rs b/src/bin/rustfmt.rs index 3e369e1ef23..c795d529409 100644 --- a/src/bin/rustfmt.rs +++ b/src/bin/rustfmt.rs @@ -17,8 +17,8 @@ extern crate toml; 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(); |
