about summary refs log tree commit diff
path: root/src/bin
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2015-05-23 17:02:59 +1200
committerNick Cameron <ncameron@mozilla.com>2015-05-23 17:53:53 +1200
commit1a09a6d00a782db90501c0921dd4c7587f6eba72 (patch)
treefff5155cf7126bc9792894bc64e2b6d4aad86c9f /src/bin
parentaa6f7e8d3cad4ee2737d9dce662977f216e01096 (diff)
Use config file for constants
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/rustfmt.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/rustfmt.rs b/src/bin/rustfmt.rs
index 32c38ea15e4..5a12dbd639b 100644
--- a/src/bin/rustfmt.rs
+++ b/src/bin/rustfmt.rs
@@ -15,10 +15,18 @@ extern crate rustfmt;
 
 use rustfmt::{WriteMode, run};
 
+use std::fs::File;
+use std::io::Read;
+
 fn main() {
     let args: Vec<_> = std::env::args().collect();
-    //run(args, WriteMode::Display);
-    run(args, WriteMode::Overwrite);
+    let mut def_config_file = File::open("default.toml").unwrap();
+    let mut def_config = String::new();
+    def_config_file.read_to_string(&mut def_config).unwrap();
+
+    //run(args, WriteMode::Display, &def_config);
+    run(args, WriteMode::Overwrite, &def_config);
+
     std::env::set_exit_status(0);
 
     // TODO unit tests