From 4f8938c616af167e47a05abafdfa67eed5f13533 Mon Sep 17 00:00:00 2001 From: "Victor M. Suarez" Date: Tue, 12 Jan 2016 18:12:48 -0500 Subject: 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! --- src/bin/rustfmt.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bin') 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(); -- cgit 1.4.1-3-g733a5