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:
Victor M. Suarez
2016-01-12 18:12:48 -05:00
parent ba465e0fc2
commit 4f8938c616
7 changed files with 100 additions and 108 deletions
+3 -3
View File
@@ -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();