1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #[derive(RustcDecodable)]
16 pub ideal_width: usize,
18 pub tab_spaces: usize,
19 pub newline_style: ::NewlineStyle,
20 pub fn_brace_style: ::BraceStyle,
21 pub fn_return_indent: ::ReturnIndent,
22 pub fn_args_paren_newline: bool,
23 pub struct_trailing_comma: bool,
24 pub struct_lit_trailing_comma: ::lists::SeparatorTactic,
25 pub enum_trailing_comma: bool,
29 fn from_toml(toml: &str) -> Config {
30 let parsed = toml.parse().unwrap();
31 toml::decode(parsed).unwrap()
35 pub fn set_config(toml: &str) {
37 ::CONFIG = Some(Config::from_toml(toml));
43 unsafe { ::CONFIG.as_ref().unwrap().$name }