@@ -2303,6 +2303,7 @@ pub struct IterU32Digits<'a> {
2303
2303
}
2304
2304
#[ cfg( u64_digit) ]
2305
2305
impl < ' a > IterU32Digits < ' a > {
2306
+ #[ inline]
2306
2307
fn new ( data : & ' a [ u64 ] ) -> Self {
2307
2308
let last_hi_is_zero = data
2308
2309
. last ( )
@@ -2321,6 +2322,7 @@ impl<'a> IterU32Digits<'a> {
2321
2322
#[ cfg( u64_digit) ]
2322
2323
impl Iterator for IterU32Digits < ' _ > {
2323
2324
type Item = u32 ;
2325
+ #[ inline]
2324
2326
fn next ( & mut self ) -> Option < u32 > {
2325
2327
match self . data . split_first ( ) {
2326
2328
Some ( ( & first, data) ) => {
@@ -2342,11 +2344,13 @@ impl Iterator for IterU32Digits<'_> {
2342
2344
}
2343
2345
}
2344
2346
2347
+ #[ inline]
2345
2348
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2346
2349
let len = self . len ( ) ;
2347
2350
( len, Some ( len) )
2348
2351
}
2349
2352
2353
+ #[ inline]
2350
2354
fn last ( self ) -> Option < u32 > {
2351
2355
self . data . last ( ) . map ( |& last| {
2352
2356
if self . last_hi_is_zero {
@@ -2357,48 +2361,57 @@ impl Iterator for IterU32Digits<'_> {
2357
2361
} )
2358
2362
}
2359
2363
2364
+ #[ inline]
2360
2365
fn count ( self ) -> usize {
2361
2366
self . len ( )
2362
2367
}
2363
2368
}
2364
2369
#[ cfg( u64_digit) ]
2365
2370
impl ExactSizeIterator for IterU32Digits < ' _ > {
2371
+ #[ inline]
2366
2372
fn len ( & self ) -> usize {
2367
2373
self . data . len ( ) * 2 - usize:: from ( self . last_hi_is_zero ) - usize:: from ( !self . next_is_lo )
2368
2374
}
2369
2375
}
2370
2376
2371
2377
#[ cfg( not( u64_digit) ) ]
2372
2378
impl < ' a > IterU32Digits < ' a > {
2379
+ #[ inline]
2373
2380
fn new ( data : & ' a [ u32 ] ) -> Self {
2374
2381
Self { it : data. iter ( ) }
2375
2382
}
2376
2383
}
2377
2384
#[ cfg( not( u64_digit) ) ]
2378
2385
impl Iterator for IterU32Digits < ' _ > {
2379
2386
type Item = u32 ;
2387
+ #[ inline]
2380
2388
fn next ( & mut self ) -> Option < u32 > {
2381
2389
self . it . next ( ) . cloned ( )
2382
2390
}
2383
2391
2392
+ #[ inline]
2384
2393
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2385
2394
self . it . size_hint ( )
2386
2395
}
2387
2396
2397
+ #[ inline]
2388
2398
fn nth ( & mut self , n : usize ) -> Option < u32 > {
2389
2399
self . it . nth ( n) . cloned ( )
2390
2400
}
2391
2401
2402
+ #[ inline]
2392
2403
fn last ( self ) -> Option < u32 > {
2393
2404
self . it . last ( ) . cloned ( )
2394
2405
}
2395
2406
2407
+ #[ inline]
2396
2408
fn count ( self ) -> usize {
2397
2409
self . it . count ( )
2398
2410
}
2399
2411
}
2400
2412
#[ cfg( not( u64_digit) ) ]
2401
2413
impl ExactSizeIterator for IterU32Digits < ' _ > {
2414
+ #[ inline]
2402
2415
fn len ( & self ) -> usize {
2403
2416
self . it . len ( )
2404
2417
}
@@ -2417,6 +2430,7 @@ pub struct IterU64Digits<'a> {
2417
2430
}
2418
2431
#[ cfg( not( u64_digit) ) ]
2419
2432
impl < ' a > IterU64Digits < ' a > {
2433
+ #[ inline]
2420
2434
fn new ( data : & ' a [ u32 ] ) -> Self {
2421
2435
IterU64Digits { it : data. chunks ( 2 ) }
2422
2436
}
@@ -2425,61 +2439,73 @@ impl<'a> IterU64Digits<'a> {
2425
2439
#[ cfg( not( u64_digit) ) ]
2426
2440
impl Iterator for IterU64Digits < ' _ > {
2427
2441
type Item = u64 ;
2442
+ #[ inline]
2428
2443
fn next ( & mut self ) -> Option < u64 > {
2429
2444
self . it . next ( ) . map ( u32_chunk_to_u64)
2430
2445
}
2431
2446
2447
+ #[ inline]
2432
2448
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2433
2449
let len = self . len ( ) ;
2434
2450
( len, Some ( len) )
2435
2451
}
2436
2452
2453
+ #[ inline]
2437
2454
fn last ( self ) -> Option < u64 > {
2438
2455
self . it . last ( ) . map ( u32_chunk_to_u64)
2439
2456
}
2440
2457
2458
+ #[ inline]
2441
2459
fn count ( self ) -> usize {
2442
2460
self . len ( )
2443
2461
}
2444
2462
}
2445
2463
#[ cfg( not( u64_digit) ) ]
2446
2464
impl ExactSizeIterator for IterU64Digits < ' _ > {
2465
+ #[ inline]
2447
2466
fn len ( & self ) -> usize {
2448
2467
self . it . len ( )
2449
2468
}
2450
2469
}
2451
2470
2452
2471
#[ cfg( u64_digit) ]
2453
2472
impl < ' a > IterU64Digits < ' a > {
2473
+ #[ inline]
2454
2474
fn new ( data : & ' a [ u64 ] ) -> Self {
2455
2475
Self { it : data. iter ( ) }
2456
2476
}
2457
2477
}
2458
2478
#[ cfg( u64_digit) ]
2459
2479
impl Iterator for IterU64Digits < ' _ > {
2460
2480
type Item = u64 ;
2481
+ #[ inline]
2461
2482
fn next ( & mut self ) -> Option < u64 > {
2462
2483
self . it . next ( ) . cloned ( )
2463
2484
}
2464
2485
2486
+ #[ inline]
2465
2487
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
2466
2488
self . it . size_hint ( )
2467
2489
}
2468
2490
2491
+ #[ inline]
2469
2492
fn nth ( & mut self , n : usize ) -> Option < u64 > {
2470
2493
self . it . nth ( n) . cloned ( )
2471
2494
}
2472
2495
2496
+ #[ inline]
2473
2497
fn last ( self ) -> Option < u64 > {
2474
2498
self . it . last ( ) . cloned ( )
2475
2499
}
2476
2500
2501
+ #[ inline]
2477
2502
fn count ( self ) -> usize {
2478
2503
self . it . count ( )
2479
2504
}
2480
2505
}
2481
2506
#[ cfg( u64_digit) ]
2482
2507
impl ExactSizeIterator for IterU64Digits < ' _ > {
2508
+ #[ inline]
2483
2509
fn len ( & self ) -> usize {
2484
2510
self . it . len ( )
2485
2511
}
0 commit comments