File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
crates/string-offsets/src Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -246,11 +246,11 @@ mod tests {
246
246
let br3 = bitrank ( BITS_PER_BLOCK + 6 , bits3) ;
247
247
assert_eq ! ( br3. rank( BITS_PER_BLOCK ) , BITS_PER_BLOCK ) ;
248
248
249
- let bits4: Vec < usize > = vec ! [ 1 , 1000 , 9999 , BITS_PER_BLOCK + 1 ] ;
249
+ let bits4: Vec < usize > = vec ! [ 1 , 1000 , 7777 , BITS_PER_BLOCK + 1 ] ;
250
250
let br4 = bitrank ( BITS_PER_BLOCK + 1 , bits4) ;
251
- assert_eq ! ( br4. rank( 10000 ) , 3 ) ;
251
+ assert_eq ! ( br4. rank( 8000 ) , 3 ) ;
252
252
253
- let bits5: Vec < usize > = vec ! [ 1 , 1000 , 9999 , BITS_PER_BLOCK + 1 ] ;
253
+ let bits5: Vec < usize > = vec ! [ 1 , 1000 , 7777 , BITS_PER_BLOCK + 1 ] ;
254
254
let br5 = bitrank ( BITS_PER_BLOCK + 1 , bits5) ;
255
255
assert_eq ! ( br5. rank( BITS_PER_BLOCK ) , 3 ) ;
256
256
}
Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ fn new_converter(content: &[u8]) -> StringOffsets {
375
375
let mut line_begins = vec ! [ 0 ] ;
376
376
let mut whitespace_only = vec ! [ ] ;
377
377
let mut only_whitespaces = true ; // true if all characters in the current line are whitespaces.
378
- for ( i, & c) in content. into_iter ( ) . enumerate ( ) {
378
+ for ( i, & c) in content. iter ( ) . enumerate ( ) {
379
379
// Note: We expect here proper utf8 encoded strings! Otherwise, the conversion will have undefined behaviour.
380
380
if is_char_boundary ( c) {
381
381
utf8_builder. push ( i) ;
You can’t perform that action at this time.
0 commit comments