diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-05-23 17:02:59 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-05-23 17:53:53 +1200 |
| commit | 1a09a6d00a782db90501c0921dd4c7587f6eba72 (patch) | |
| tree | fff5155cf7126bc9792894bc64e2b6d4aad86c9f /src/bin | |
| parent | aa6f7e8d3cad4ee2737d9dce662977f216e01096 (diff) | |
Use config file for constants
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/rustfmt.rs | 12 |
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 |
