@@ -146,8 +146,7 @@ impl<'a> DigitInfo<'a> {
146
146
let group_size = self . radix . suggest_grouping ( ) ;
147
147
if self . digits . contains ( '.' ) {
148
148
let mut parts = self . digits . split ( '.' ) ;
149
- let int_part_hint = parts
150
- . next ( )
149
+ let int_part_hint = parts. next ( )
151
150
. unwrap ( )
152
151
. chars ( )
153
152
. rev ( )
@@ -158,8 +157,7 @@ impl<'a> DigitInfo<'a> {
158
157
. rev ( )
159
158
. collect :: < Vec < String > > ( )
160
159
. join ( "_" ) ;
161
- let frac_part_hint = parts
162
- . next ( )
160
+ let frac_part_hint = parts. next ( )
163
161
. unwrap ( )
164
162
. chars ( )
165
163
. filter ( |& c| c != '_' )
@@ -196,31 +194,25 @@ impl WarningType {
196
194
pub fn display ( & self , grouping_hint : & str , cx : & EarlyContext , span : & syntax_pos:: Span ) {
197
195
match * self {
198
196
WarningType :: UnreadableLiteral => {
199
- span_help_and_lint (
200
- cx,
201
- UNREADABLE_LITERAL ,
202
- * span,
203
- "long literal lacking separators" ,
204
- & format ! ( "consider: {}" , grouping_hint) ,
205
- )
197
+ span_help_and_lint ( cx,
198
+ UNREADABLE_LITERAL ,
199
+ * span,
200
+ "long literal lacking separators" ,
201
+ & format ! ( "consider: {}" , grouping_hint) )
206
202
} ,
207
203
WarningType :: LargeDigitGroups => {
208
- span_help_and_lint (
209
- cx,
210
- LARGE_DIGIT_GROUPS ,
211
- * span,
212
- "digit groups should be smaller" ,
213
- & format ! ( "consider: {}" , grouping_hint) ,
214
- )
204
+ span_help_and_lint ( cx,
205
+ LARGE_DIGIT_GROUPS ,
206
+ * span,
207
+ "digit groups should be smaller" ,
208
+ & format ! ( "consider: {}" , grouping_hint) )
215
209
} ,
216
210
WarningType :: InconsistentDigitGrouping => {
217
- span_help_and_lint (
218
- cx,
219
- INCONSISTENT_DIGIT_GROUPING ,
220
- * span,
221
- "digits grouped inconsistently by underscores" ,
222
- & format ! ( "consider: {}" , grouping_hint) ,
223
- )
211
+ span_help_and_lint ( cx,
212
+ INCONSISTENT_DIGIT_GROUPING ,
213
+ * span,
214
+ "digits grouped inconsistently by underscores" ,
215
+ & format ! ( "consider: {}" , grouping_hint) )
224
216
} ,
225
217
} ;
226
218
}
@@ -317,8 +309,7 @@ impl LiteralDigitGrouping {
317
309
/// size on success or `WarningType` when emitting a warning.
318
310
fn do_lint ( digits : & str ) -> Result < usize , WarningType > {
319
311
// Grab underscore indices with respect to the units digit.
320
- let underscore_positions: Vec < usize > = digits
321
- . chars ( )
312
+ let underscore_positions: Vec < usize > = digits. chars ( )
322
313
. rev ( )
323
314
. enumerate ( )
324
315
. filter_map ( |( idx, digit) | if digit == '_' { Some ( idx) } else { None } )
0 commit comments