Skip to content

Commit

Permalink
Removed iter_*_digits_be() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickNorton committed Jul 28, 2021
1 parent 37dd0fa commit 1597792
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 338 deletions.
40 changes: 0 additions & 40 deletions src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ enum CheckedUnsignedAbs<T> {
Negative(T),
}
use self::CheckedUnsignedAbs::{Negative, Positive};
use crate::{U32DigitsBe, U64DigitsBe};

macro_rules! impl_unsigned_abs {
($Signed:ty, $Unsigned:ty) => {
Expand Down Expand Up @@ -826,45 +825,6 @@ impl BigInt {
self.data.iter_u64_digits()
}

/// Returns an iterator of `u32` digits representation of the `BigInt` ordered most
/// significant digit first.
///
/// # Examples
///
/// ```
/// use num_bigint::BigInt;
///
/// assert_eq!(BigInt::from(-1125).iter_u32_digits().collect::<Vec<u32>>(), vec![1125]);
/// assert_eq!(BigInt::from(4294967295u32).iter_u32_digits().collect::<Vec<u32>>(), vec![4294967295]);
/// assert_eq!(BigInt::from(4294967296u64).iter_u32_digits().collect::<Vec<u32>>(), vec![1, 0]);
/// assert_eq!(BigInt::from(-112500000000i64).iter_u32_digits().collect::<Vec<u32>>(), vec![26, 830850304]);
/// assert_eq!(BigInt::from(112500000000i64).iter_u32_digits().collect::<Vec<u32>>(), vec![26, 830850304]);
/// ```
#[inline]
pub fn iter_u32_digits_be(&self) -> U32DigitsBe<'_> {
self.data.iter_u32_digits_be()
}

/// Returns an iterator of `u64` digits representation of the `BigInt` ordered most
/// significant digit first.
///
/// # Examples
///
/// ```
/// use num_bigint::BigInt;
///
/// assert_eq!(BigInt::from(-1125).iter_u64_digits().collect::<Vec<u64>>(), vec![1125u64]);
/// assert_eq!(BigInt::from(4294967295u32).iter_u64_digits().collect::<Vec<u64>>(), vec![4294967295u64]);
/// assert_eq!(BigInt::from(4294967296u64).iter_u64_digits().collect::<Vec<u64>>(), vec![4294967296u64]);
/// assert_eq!(BigInt::from(-112500000000i64).iter_u64_digits().collect::<Vec<u64>>(), vec![112500000000u64]);
/// assert_eq!(BigInt::from(112500000000i64).iter_u64_digits().collect::<Vec<u64>>(), vec![112500000000u64]);
/// assert_eq!(BigInt::from(1u128 << 64).iter_u64_digits().collect::<Vec<u64>>(), vec![1, 0]);
/// ```
#[inline]
pub fn iter_u64_digits_be(&self) -> U64DigitsBe<'_> {
self.data.iter_u64_digits_be()
}

/// Returns the two's-complement byte representation of the `BigInt` in big-endian byte order.
///
/// # Examples
Expand Down
39 changes: 0 additions & 39 deletions src/biguint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ mod arbitrary;

#[cfg(feature = "serde")]
mod serde;
mod iter_be;

pub(crate) use self::convert::to_str_radix_reversed;
pub use self::iter::{U32Digits, U64Digits};
pub use self::iter_be::{U32DigitsBe, U64DigitsBe};

/// A big unsigned integer type.
pub struct BigUint {
Expand Down Expand Up @@ -776,43 +774,6 @@ impl BigUint {
U64Digits::new(self.data.as_slice())
}

/// Returns an iterator of `u32` digits representation of the `BigUint` ordered least
/// significant digit first.
///
/// # Examples
///
/// ```
/// use num_bigint::BigUint;
///
/// assert_eq!(BigUint::from(1125u32).iter_u32_digits_be().collect::<Vec<u32>>(), vec![1125]);
/// assert_eq!(BigUint::from(4294967295u32).iter_u32_digits_be().collect::<Vec<u32>>(), vec![4294967295]);
/// assert_eq!(BigUint::from(4294967296u64).iter_u32_digits_be().collect::<Vec<u32>>(), vec![0, 1]);
/// assert_eq!(BigUint::from(112500000000u64).iter_u32_digits_be().collect::<Vec<u32>>(), vec![26, 830850304]);
/// ```
#[inline]
pub fn iter_u32_digits_be(&self) -> U32DigitsBe<'_> {
U32DigitsBe::new(self.data.as_slice())
}

/// Returns an iterator of `u64` digits representation of the `BigUint` ordered least
/// significant digit first.
///
/// # Examples
///
/// ```
/// use num_bigint::BigUint;
///
/// assert_eq!(BigUint::from(1125u32).iter_u64_digits_be().collect::<Vec<u64>>(), vec![1125]);
/// assert_eq!(BigUint::from(4294967295u32).iter_u64_digits_be().collect::<Vec<u64>>(), vec![4294967295]);
/// assert_eq!(BigUint::from(4294967296u64).iter_u64_digits_be().collect::<Vec<u64>>(), vec![4294967296]);
/// assert_eq!(BigUint::from(112500000000u64).iter_u64_digits_be().collect::<Vec<u64>>(), vec![112500000000]);
/// assert_eq!(BigUint::from(1u128 << 64).iter_u64_digits_be().collect::<Vec<u64>>(), vec![1, 0]);
/// ```
#[inline]
pub fn iter_u64_digits_be(&self) -> U64DigitsBe<'_> {
U64DigitsBe::new(self.data.as_slice())
}

/// Returns the integer formatted as a string in the given radix.
/// `radix` must be in the range `2...36`.
///
Expand Down
257 changes: 0 additions & 257 deletions src/biguint/iter_be.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ pub use crate::biguint::BigUint;
pub use crate::biguint::ToBigUint;
pub use crate::biguint::U32Digits;
pub use crate::biguint::U64Digits;
pub use crate::biguint::U32DigitsBe;
pub use crate::biguint::U64DigitsBe;

pub use crate::bigint::BigInt;
pub use crate::bigint::Sign;
Expand Down

0 comments on commit 1597792

Please sign in to comment.