Skip to content

Commit fea0bee

Browse files
committed
unify ExactSizeIterator for U64Digits
1 parent 5f7471a commit fea0bee

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/biguint.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,7 @@ pub struct U32Digits<'a> {
23012301
#[cfg(not(u64_digit))]
23022302
it: core::slice::Iter<'a, u32>,
23032303
}
2304+
23042305
#[cfg(u64_digit)]
23052306
impl<'a> U32Digits<'a> {
23062307
#[inline]
@@ -2319,6 +2320,7 @@ impl<'a> U32Digits<'a> {
23192320
}
23202321
}
23212322
}
2323+
23222324
#[cfg(u64_digit)]
23232325
impl Iterator for U32Digits<'_> {
23242326
type Item = u32;
@@ -2366,6 +2368,7 @@ impl Iterator for U32Digits<'_> {
23662368
self.len()
23672369
}
23682370
}
2371+
23692372
#[cfg(u64_digit)]
23702373
impl ExactSizeIterator for U32Digits<'_> {
23712374
#[inline]
@@ -2381,6 +2384,7 @@ impl<'a> U32Digits<'a> {
23812384
Self { it: data.iter() }
23822385
}
23832386
}
2387+
23842388
#[cfg(not(u64_digit))]
23852389
impl Iterator for U32Digits<'_> {
23862390
type Item = u32;
@@ -2409,6 +2413,7 @@ impl Iterator for U32Digits<'_> {
24092413
self.it.count()
24102414
}
24112415
}
2416+
24122417
#[cfg(not(u64_digit))]
24132418
impl ExactSizeIterator for U32Digits<'_> {
24142419
#[inline]
@@ -2428,6 +2433,7 @@ pub struct U64Digits<'a> {
24282433
#[cfg(u64_digit)]
24292434
it: core::slice::Iter<'a, u64>,
24302435
}
2436+
24312437
#[cfg(not(u64_digit))]
24322438
impl<'a> U64Digits<'a> {
24332439
#[inline]
@@ -2460,13 +2466,6 @@ impl Iterator for U64Digits<'_> {
24602466
self.len()
24612467
}
24622468
}
2463-
#[cfg(not(u64_digit))]
2464-
impl ExactSizeIterator for U64Digits<'_> {
2465-
#[inline]
2466-
fn len(&self) -> usize {
2467-
self.it.len()
2468-
}
2469-
}
24702469

24712470
#[cfg(u64_digit)]
24722471
impl<'a> U64Digits<'a> {
@@ -2475,6 +2474,7 @@ impl<'a> U64Digits<'a> {
24752474
Self { it: data.iter() }
24762475
}
24772476
}
2477+
24782478
#[cfg(u64_digit)]
24792479
impl Iterator for U64Digits<'_> {
24802480
type Item = u64;
@@ -2503,13 +2503,14 @@ impl Iterator for U64Digits<'_> {
25032503
self.it.count()
25042504
}
25052505
}
2506-
#[cfg(u64_digit)]
2506+
25072507
impl ExactSizeIterator for U64Digits<'_> {
25082508
#[inline]
25092509
fn len(&self) -> usize {
25102510
self.it.len()
25112511
}
25122512
}
2513+
25132514
impl FusedIterator for U64Digits<'_> {}
25142515

25152516
/// Creates and initializes a `BigUint`.

0 commit comments

Comments
 (0)