Skip to content

Commit 5864072

Browse files
committed
Run rustfmt
1 parent deed00a commit 5864072

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

clippy_lints/src/literal_digit_grouping.rs

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ impl<'a> DigitInfo<'a> {
146146
let group_size = self.radix.suggest_grouping();
147147
if self.digits.contains('.') {
148148
let mut parts = self.digits.split('.');
149-
let int_part_hint = parts
150-
.next()
149+
let int_part_hint = parts.next()
151150
.unwrap()
152151
.chars()
153152
.rev()
@@ -158,8 +157,7 @@ impl<'a> DigitInfo<'a> {
158157
.rev()
159158
.collect::<Vec<String>>()
160159
.join("_");
161-
let frac_part_hint = parts
162-
.next()
160+
let frac_part_hint = parts.next()
163161
.unwrap()
164162
.chars()
165163
.filter(|&c| c != '_')
@@ -196,31 +194,25 @@ impl WarningType {
196194
pub fn display(&self, grouping_hint: &str, cx: &EarlyContext, span: &syntax_pos::Span) {
197195
match *self {
198196
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))
206202
},
207203
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))
215209
},
216210
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))
224216
},
225217
};
226218
}
@@ -317,8 +309,7 @@ impl LiteralDigitGrouping {
317309
/// size on success or `WarningType` when emitting a warning.
318310
fn do_lint(digits: &str) -> Result<usize, WarningType> {
319311
// 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()
322313
.rev()
323314
.enumerate()
324315
.filter_map(|(idx, digit)| if digit == '_' { Some(idx) } else { None })

clippy_lints/src/misc.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
226226
}
227227
for arg in iter_input_pats(decl, body) {
228228
match arg.pat.node {
229-
PatKind::Binding(BindingAnnotation::Ref, _, _, _) | PatKind::Binding(BindingAnnotation::RefMut, _, _, _) => {
229+
PatKind::Binding(BindingAnnotation::Ref, _, _, _) |
230+
PatKind::Binding(BindingAnnotation::RefMut, _, _, _) => {
230231
span_lint(cx,
231232
TOPLEVEL_REF_ARG,
232233
arg.pat.span,
233-
"`ref` directly on a function argument is ignored. Consider using a reference type instead.");
234+
"`ref` directly on a function argument is ignored. Consider using a reference type \
235+
instead.");
234236
},
235-
_ => {}
237+
_ => {},
236238
}
237239
}
238240
}

0 commit comments

Comments
 (0)