File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ impl<'a> DigitInfo<'a> {
147
147
if self . digits . contains ( '.' ) {
148
148
let mut parts = self . digits . split ( '.' ) ;
149
149
let int_part_hint = parts. next ( )
150
- . unwrap ( )
150
+ . expect ( "split always returns at least one element" )
151
151
. chars ( )
152
152
. rev ( )
153
153
. filter ( |& c| c != '_' )
@@ -158,7 +158,7 @@ impl<'a> DigitInfo<'a> {
158
158
. collect :: < Vec < String > > ( )
159
159
. join ( "_" ) ;
160
160
let frac_part_hint = parts. next ( )
161
- . unwrap ( )
161
+ . expect ( "already checked that there is a `.`" )
162
162
. chars ( )
163
163
. filter ( |& c| c != '_' )
164
164
. collect :: < Vec < _ > > ( )
@@ -329,7 +329,7 @@ impl LiteralDigitGrouping {
329
329
. windows ( 2 )
330
330
. all ( |ps| ps[ 1 ] - ps[ 0 ] == group_size + 1 )
331
331
// 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 ) ;
333
333
334
334
if !consistent {
335
335
return Err ( WarningType :: InconsistentDigitGrouping ) ;
You can’t perform that action at this time.
0 commit comments