Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/big_quickcheck/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Quickcheck of `BigUint` and `BigInt`
//! Quickcheck of [`BigUint`] and [`BigInt`]
//!
//! This test is in a completely separate crate so we can use `quickcheck_macros` only when
//! `quickcheck` is active. The main crate can't have optional dev-dependencies, and it's
Expand Down
2 changes: 1 addition & 1 deletion ci/big_rand/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Test randomization of `BigUint` and `BigInt`
//! Test randomization of [`BigUint`] and [`BigInt`]
//!
//! This test is in a completely separate crate so `rand::thread_rng()`
//! can be available without "infecting" the rest of the build with
Expand Down
2 changes: 1 addition & 1 deletion ci/big_serde/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Test serialization and deserialization of `BigUint` and `BigInt`
//! Test serialization and deserialization of [`BigUint`] and [`BigInt`]
//!
//! The serialized formats should not change, even if we change our
//! internal representation, because we want to preserve forward and
Expand Down
4 changes: 2 additions & 2 deletions src/bigint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// `Add`/`Sub` ops may flip from `BigInt` to its `BigUint` magnitude
// `Add`/`Sub` ops may flip from [`BigInt`] to its [`BigUint`] magnitude
#![allow(clippy::suspicious_arithmetic_impl)]

use alloc::string::String;
Expand Down Expand Up @@ -563,7 +563,7 @@ pub trait ToBigInt {
}

impl BigInt {
/// A constant `BigInt` with value 0, useful for static initialization.
/// A constant [`BigInt`] with value 0, useful for static initialization.
pub const ZERO: Self = BigInt {
sign: NoSign,
data: BigUint::ZERO,
Expand Down
2 changes: 1 addition & 1 deletion src/biguint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ pub(crate) fn biguint_from_vec(digits: Vec<BigDigit>) -> BigUint {
}

impl BigUint {
/// A constant `BigUint` with value 0, useful for static initialization.
/// A constant [`BigUint`] with value 0, useful for static initialization.
pub const ZERO: Self = BigUint { data: Vec::new() };

/// Creates and initializes a [`BigUint`].
Expand Down
4 changes: 2 additions & 2 deletions src/biguint/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ pub(super) fn from_radix_le(buf: &[u8], radix: u32) -> Option<BigUint> {
impl Num for BigUint {
type FromStrRadixErr = ParseBigIntError;

/// Creates and initializes a `BigUint`.
/// Creates and initializes a [`BigUint`].
fn from_str_radix(s: &str, radix: u32) -> Result<BigUint, ParseBigIntError> {
assert!(2 <= radix && radix <= 36, "The radix must be within 2...36");
let mut s = s;
Expand Down Expand Up @@ -808,7 +808,7 @@ fn get_half_radix_base(radix: u32) -> (BigDigit, usize) {

/// Generate tables of the greatest power of each radix that is less that the given maximum. These
/// are returned from `get_radix_base` to batch the multiplication/division of radix conversions on
/// full `BigUint` values, operating on primitive integers as much as possible.
/// full [`BigUint`] values, operating on primitive integers as much as possible.
///
/// e.g. BASES_16[3] = (59049, 10) // 3¹⁰ fits in u16, but 3¹¹ is too big
/// BASES_32[3] = (3486784401, 20)
Expand Down
8 changes: 4 additions & 4 deletions src/biguint/iter.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use core::iter::FusedIterator;

cfg_digit!(
/// An iterator of `u32` digits representation of a `BigUint` or `BigInt`,
/// An iterator of `u32` digits representation of a [`BigUint`](super::BigUint) or [`BigInt`](super::super::BigInt),
/// ordered least significant digit first.
pub struct U32Digits<'a> {
it: core::slice::Iter<'a, u32>,
}

/// An iterator of `u32` digits representation of a `BigUint` or `BigInt`,
/// An iterator of `u32` digits representation of a [`BigUint`](super::BigUint) or [`BigInt`](super::super::BigInt),
/// ordered least significant digit first.
pub struct U32Digits<'a> {
data: &'a [u64],
Expand Down Expand Up @@ -170,13 +170,13 @@ cfg_digit!(
impl FusedIterator for U32Digits<'_> {}

cfg_digit!(
/// An iterator of `u64` digits representation of a `BigUint` or `BigInt`,
/// An iterator of `u64` digits representation of a [`BigUint`](super::BigUint) or [`BigInt`](super::super::BigInt),
/// ordered least significant digit first.
pub struct U64Digits<'a> {
it: core::slice::Chunks<'a, u32>,
}

/// An iterator of `u64` digits representation of a `BigUint` or `BigInt`,
/// An iterator of `u64` digits representation of a [`BigUint`](super::BigUint) or [`BigInt`](super::super::BigInt),
/// ordered least significant digit first.
pub struct U64Digits<'a> {
it: core::slice::Iter<'a, u64>,
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
//! The `std` crate feature is enabled by default, which enables [`std::error::Error`]
//! implementations and some internal use of floating point approximations. This can be disabled by
//! depending on `num-bigint` with `default-features = false`. Either way, the `alloc` crate is
//! always required for heap allocation of the `BigInt`/`BigUint` digits.
//! always required for heap allocation of the [`BigInt`]/[`BigUint`] digits.
//!
//! ### Random Generation
//!
Expand All @@ -81,13 +81,13 @@
//! ### Arbitrary Big Integers
//!
//! `num-bigint` supports `arbitrary` and `quickcheck` features to implement
//! [`arbitrary::Arbitrary`] and [`quickcheck::Arbitrary`], respectively, for both `BigInt` and
//! `BigUint`. These are useful for fuzzing and other forms of randomized testing.
//! [`arbitrary::Arbitrary`] and [`quickcheck::Arbitrary`], respectively, for both [`BigInt`] and
//! [`BigUint`]. These are useful for fuzzing and other forms of randomized testing.
//!
//! ### Serialization
//!
//! The `serde` feature adds implementations of [`Serialize`][serde::Serialize] and
//! [`Deserialize`][serde::Deserialize] for both `BigInt` and `BigUint`. Their serialized data is
//! [`Deserialize`][serde::Deserialize] for both [`BigInt`] and [`BigUint`]. Their serialized data is
//! generated portably, regardless of platform differences like the internal digit size.
//!
//!
Expand Down