Skip to content

Commit 6bdb597

Browse files
committed
Fix some more dogfood issues
1 parent a5fe4be commit 6bdb597

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/literal_digit_grouping.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'a> DigitInfo<'a> {
147147
if self.digits.contains('.') {
148148
let mut parts = self.digits.split('.');
149149
let int_part_hint = parts.next()
150-
.unwrap()
150+
.expect("split always returns at least one element")
151151
.chars()
152152
.rev()
153153
.filter(|&c| c != '_')
@@ -158,7 +158,7 @@ impl<'a> DigitInfo<'a> {
158158
.collect::<Vec<String>>()
159159
.join("_");
160160
let frac_part_hint = parts.next()
161-
.unwrap()
161+
.expect("already checked that there is a `.`")
162162
.chars()
163163
.filter(|&c| c != '_')
164164
.collect::<Vec<_>>()
@@ -329,7 +329,7 @@ impl LiteralDigitGrouping {
329329
.windows(2)
330330
.all(|ps| ps[1] - ps[0] == group_size + 1)
331331
// number of digits to the left of the last group cannot be bigger than group size.
332-
&& (digits.len() - underscore_positions.last().unwrap() <= group_size + 1);
332+
&& (digits.len() - underscore_positions.last().expect("there's at least one element") <= group_size + 1);
333333

334334
if !consistent {
335335
return Err(WarningType::InconsistentDigitGrouping);

0 commit comments

Comments
 (0)