]> git.lizzy.rs Git - rust.git/blobdiff - src/config.rs
Add explicit lifetime
[rust.git] / src / config.rs
index 173f076bebb31c1bbe48aefcec6ad4510ffe931f..30d79cdc562983b00017c01c574c3b4e346d0e4c 100644 (file)
@@ -17,7 +17,7 @@
 use std::path::{Path, PathBuf};
 
 use file_lines::FileLines;
-use lists::{ListTactic, SeparatorTactic};
+use lists::{ListTactic, SeparatorPlace, SeparatorTactic};
 
 macro_rules! configuration_option_enum{
     ($e:ident: $( $x:ident ),+ $(,)*) => {
@@ -306,7 +306,7 @@ pub fn from_toml(toml: &str) -> Result<Config, String> {
                     let table = parsed
                         .as_table()
                         .ok_or(String::from("Parsed config was not table"))?;
-                    for (key, _) in table {
+                    for key in table.keys() {
                         match &**key {
                             $(
                                 stringify!($i) => (),
@@ -501,6 +501,7 @@ pub fn get_toml_path(dir: &Path) -> Result<Option<PathBuf>, Error> {
          via the --file-lines option";
     max_width: usize, 100, "Maximum width of each line";
     error_on_line_overflow: bool, true, "Error if unable to get all lines within max_width";
+    error_on_line_overflow_comments: bool, true, "Error if unable to get comments within max_width";
     tab_spaces: usize, 4, "Number of spaces per tab";
     fn_call_width: usize, 60,
         "Maximum width of the args of a function call before falling back to vertical formatting";
@@ -539,7 +540,7 @@ pub fn get_toml_path(dir: &Path) -> Result<Option<PathBuf>, Error> {
     // 1. Should we at least try to put the where clause on the same line as the rest of the
     // function decl?
     // 2. Currently options `Tall` and `Vertical` produce the same output.
-    where_density: Density, Density::CompressedIfEmpty, "Density of a where clause";
+    where_density: Density, Density::Vertical, "Density of a where clause";
     where_layout: ListTactic, ListTactic::Vertical, "Element layout inside a where clause";
     where_pred_indent: IndentStyle, IndentStyle::Visual,
         "Indentation style of a where predicate";
@@ -558,6 +559,8 @@ pub fn get_toml_path(dir: &Path) -> Result<Option<PathBuf>, Error> {
                                             exceeds `chain_one_line_max`";
     imports_indent: IndentStyle, IndentStyle::Visual, "Indent of imports";
     imports_layout: ListTactic, ListTactic::Mixed, "Item layout inside a import block";
+    reorder_extern_crates: bool, true, "Reorder extern crate statements alphabetically";
+    reorder_extern_crates_in_group: bool, true, "Reorder extern crate statements in group";
     reorder_imports: bool, false, "Reorder import statements alphabetically";
     reorder_imports_in_group: bool, false, "Reorder import statements in group";
     reorder_imported_names: bool, true,
@@ -578,6 +581,8 @@ pub fn get_toml_path(dir: &Path) -> Result<Option<PathBuf>, Error> {
         "Put a trailing comma after a block based match arm (non-block arms are not affected)";
     indent_match_arms: bool, true, "Indent match arms instead of keeping them at the same \
                                     indentation level as the match keyword";
+    match_pattern_separator_break_point: SeparatorPlace, SeparatorPlace::Back,
+        "Put a match sub-patterns' separator in front or back.";
     closure_block_indent_threshold: isize, 7, "How many lines a closure must have before it is \
                                                block indented. -1 means never use block indent.";
     space_before_type_annotation: bool, false,
@@ -596,13 +601,25 @@ pub fn get_toml_path(dir: &Path) -> Result<Option<PathBuf>, Error> {
     spaces_within_square_brackets: bool, false, "Put spaces within non-empty square brackets";
     spaces_within_parens: bool, false, "Put spaces within non-empty parentheses";
     use_try_shorthand: bool, false, "Replace uses of the try! macro by the ? shorthand";
-    write_mode: WriteMode, WriteMode::Replace,
-        "What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage";
+    write_mode: WriteMode, WriteMode::Overwrite,
+        "What Write Mode to use when none is supplied: \
+         Replace, Overwrite, Display, Plain, Diff, Coverage";
     condense_wildcard_suffixes: bool, false, "Replace strings of _ wildcards by a single .. in \
                                               tuple patterns";
     combine_control_expr: bool, true, "Combine control expressions with funciton calls.";
     struct_field_align_threshold: usize, 0, "Align struct fields if their diffs fits within \
-                                             threshold."
+                                             threshold.";
+    remove_blank_lines_at_start_or_end_of_block: bool, true,
+        "Remove blank lines at start or end of a block";
+    attributes_on_same_line_as_field: bool, true,
+        "Try to put attributes on the same line as fields.";
+    attributes_on_same_line_as_variant: bool, true,
+        "Try to put attributes on the same line as variants in enum declarations.";
+    multiline_closure_forces_block: bool, false,
+        "Force multiline closure bodies to be wrapped in a block";
+    multiline_match_arm_forces_block: bool, false,
+        "Force multiline match arm bodies to be wrapped in a block";
+    merge_derives: bool, true, "Merge multiple `#[derive(...)]` into a single one";
 }
 
 #[cfg(test)]