]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/literal_digit_grouping.rs
Run rustfmt
[rust.git] / clippy_lints / src / literal_digit_grouping.rs
index ec80e6968f85b45e7daf194290c0d47b534baba4..2ad26cbc36e2ed2df9f89043cf3d9f27e07023e3 100644 (file)
@@ -146,8 +146,7 @@ fn grouping_hint(&self) -> String {
         let group_size = self.radix.suggest_grouping();
         if self.digits.contains('.') {
             let mut parts = self.digits.split('.');
-            let int_part_hint = parts
-                .next()
+            let int_part_hint = parts.next()
                 .unwrap()
                 .chars()
                 .rev()
@@ -158,8 +157,7 @@ fn grouping_hint(&self) -> String {
                 .rev()
                 .collect::<Vec<String>>()
                 .join("_");
-            let frac_part_hint = parts
-                .next()
+            let frac_part_hint = parts.next()
                 .unwrap()
                 .chars()
                 .filter(|&c| c != '_')
@@ -196,31 +194,25 @@ impl WarningType {
     pub fn display(&self, grouping_hint: &str, cx: &EarlyContext, span: &syntax_pos::Span) {
         match *self {
             WarningType::UnreadableLiteral => {
-                span_help_and_lint(
-                    cx,
-                    UNREADABLE_LITERAL,
-                    *span,
-                    "long literal lacking separators",
-                    &format!("consider: {}", grouping_hint),
-                )
+                span_help_and_lint(cx,
+                                   UNREADABLE_LITERAL,
+                                   *span,
+                                   "long literal lacking separators",
+                                   &format!("consider: {}", grouping_hint))
             },
             WarningType::LargeDigitGroups => {
-                span_help_and_lint(
-                    cx,
-                    LARGE_DIGIT_GROUPS,
-                    *span,
-                    "digit groups should be smaller",
-                    &format!("consider: {}", grouping_hint),
-                )
+                span_help_and_lint(cx,
+                                   LARGE_DIGIT_GROUPS,
+                                   *span,
+                                   "digit groups should be smaller",
+                                   &format!("consider: {}", grouping_hint))
             },
             WarningType::InconsistentDigitGrouping => {
-                span_help_and_lint(
-                    cx,
-                    INCONSISTENT_DIGIT_GROUPING,
-                    *span,
-                    "digits grouped inconsistently by underscores",
-                    &format!("consider: {}", grouping_hint),
-                )
+                span_help_and_lint(cx,
+                                   INCONSISTENT_DIGIT_GROUPING,
+                                   *span,
+                                   "digits grouped inconsistently by underscores",
+                                   &format!("consider: {}", grouping_hint))
             },
         };
     }
@@ -317,8 +309,7 @@ fn parts_consistent(int_group_size: usize, frac_group_size: usize, int_size: usi
     /// size on success or `WarningType` when emitting a warning.
     fn do_lint(digits: &str) -> Result<usize, WarningType> {
         // Grab underscore indices with respect to the units digit.
-        let underscore_positions: Vec<usize> = digits
-            .chars()
+        let underscore_positions: Vec<usize> = digits.chars()
             .rev()
             .enumerate()
             .filter_map(|(idx, digit)| if digit == '_' { Some(idx) } else { None })