Skip to content

Commit 55ddfb5

Browse files
committed
Add missing backticks and brackets in docstrings
1 parent c76ee1f commit 55ddfb5

File tree

12 files changed

+30
-30
lines changed

12 files changed

+30
-30
lines changed

src/int/div.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ impl<const LIMBS: usize> Int<LIMBS> {
3030

3131
/// Compute the quotient and remainder of `self / rhs`.
3232
///
33-
/// Returns `none` for the quotient when `Int::MIN / Int::MINUS_ONE`; that quotient cannot
34-
/// be captured in an `Int`.
33+
/// Returns `none` for the quotient when [`Int::MIN`] / [`Int::MINUS_ONE`]; that quotient cannot
34+
/// be captured in an [`Int`].
3535
///
3636
/// Example:
3737
/// ```
@@ -85,7 +85,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
8585
/// Vartime checked division operations.
8686
impl<const LIMBS: usize> Int<LIMBS> {
8787
#[inline]
88-
/// Variable time equivalent of [Self::div_rem_base]
88+
/// Variable time equivalent of [`Self::div_rem_base`]
8989
///
9090
/// This is variable only with respect to `rhs`.
9191
///
@@ -106,7 +106,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
106106
(quotient, remainder, lhs_sgn, rhs_sgn)
107107
}
108108

109-
/// Variable time equivalent of [Self::checked_div_rem]
109+
/// Variable time equivalent of [`Self::checked_div_rem`]
110110
///
111111
/// This is variable only with respect to `rhs`.
112112
///
@@ -124,7 +124,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
124124
)
125125
}
126126

127-
/// Variable time equivalent of [Self::checked_div]
127+
/// Variable time equivalent of [`Self::checked_div`]
128128
///
129129
/// This is variable only with respect to `rhs`.
130130
///
@@ -137,7 +137,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
137137
NonZero::new(*rhs).and_then(|rhs| self.checked_div_rem_vartime(&rhs).0.into())
138138
}
139139

140-
/// Variable time equivalent of [Self::rem]
140+
/// Variable time equivalent of [`Self::rem`]
141141
///
142142
/// This is variable only with respect to `rhs`.
143143
///
@@ -153,7 +153,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
153153

154154
/// Vartime checked div-floor operations.
155155
impl<const LIMBS: usize> Int<LIMBS> {
156-
/// Variable time equivalent of [Self::checked_div_rem_floor]
156+
/// Variable time equivalent of [`Self::checked_div_rem_floor`]
157157
///
158158
/// This is variable only with respect to `rhs`.
159159
///
@@ -187,7 +187,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
187187
(quotient, remainder)
188188
}
189189

190-
/// Variable time equivalent of [Self::checked_div_floor]
190+
/// Variable time equivalent of [`Self::checked_div_floor`]
191191
///
192192
/// This is variable only with respect to `rhs`.
193193
///

src/int/div_uint.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
6262
/// Vartime checked division operations.
6363
impl<const LIMBS: usize> Int<LIMBS> {
6464
#[inline]
65-
/// Variable time equivalent of [Self::div_rem_base_uint`].
65+
/// Variable time equivalent of [`Self::div_rem_base_uint`].
6666
///
6767
/// This is variable only with respect to `rhs`.
6868
///
@@ -77,7 +77,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
7777
(quotient, remainder, lhs_sgn)
7878
}
7979

80-
/// Variable time equivalent of [Self::div_rem_uint`].
80+
/// Variable time equivalent of [`Self::div_rem_uint`].
8181
///
8282
/// This is variable only with respect to `rhs`.
8383
///
@@ -94,7 +94,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
9494
)
9595
}
9696

97-
/// Variable time equivalent of [Self::div_uint`].
97+
/// Variable time equivalent of [`Self::div_uint`].
9898
///
9999
/// This is variable only with respect to `rhs`.
100100
///
@@ -107,7 +107,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
107107
self.div_rem_uint_vartime(rhs).0
108108
}
109109

110-
/// Variable time equivalent of [Self::rem_uint`].
110+
/// Variable time equivalent of [`Self::rem_uint`].
111111
///
112112
/// This is variable only with respect to `rhs`.
113113
///
@@ -205,7 +205,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
205205

206206
/// Vartime checked div-floor operations
207207
impl<const LIMBS: usize> Int<LIMBS> {
208-
/// Variable time equivalent of [Self::div_rem_floor_uint`].
208+
/// Variable time equivalent of [`Self::div_rem_floor_uint`].
209209
///
210210
/// This is variable only with respect to `rhs`.
211211
///
@@ -230,7 +230,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
230230
(quotient, remainder)
231231
}
232232

233-
/// Variable time equivalent of [Self::div_floor_uint`].
233+
/// Variable time equivalent of [`Self::div_floor_uint`].
234234
///
235235
/// This is variable only with respect to `rhs`.
236236
///
@@ -244,7 +244,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
244244
q
245245
}
246246

247-
/// Variable time equivalent of [Self::normalized_rem`].
247+
/// Variable time equivalent of [`Self::normalized_rem`].
248248
///
249249
/// This is variable only with respect to `rhs`.
250250
///

src/int/gcd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<const LIMBS: usize> Odd<Int<LIMBS>> {
177177
}
178178
}
179179

180-
/// Output of the Binary XGCD algorithm applied to two [Int]s.
180+
/// Output of the Binary XGCD algorithm applied to two [`Int`]s.
181181
pub type IntXgcdOutput<const LIMBS: usize> = XgcdOutput<LIMBS, Uint<LIMBS>>;
182182

183183
/// Output of the Binary XGCD algorithm applied to two [`NonZero<Int<LIMBS>>`]s.

src/int/mul_uint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl<const LIMBS: usize> Int<LIMBS> {
8181
*product_abs.wrapping_neg_if(lhs_sign).as_int()
8282
}
8383

84-
/// Checked multiplication of self with an `Uint<RHS_LIMBS>`, where the result is to be stored
85-
/// in an `Int<RHS_LIMBS>`.
84+
/// Checked multiplication of self with an [`Uint<RHS_LIMBS>`], where the result is to be stored
85+
/// in an [`Int<RHS_LIMBS>`].
8686
#[deprecated(since = "0.7.0", note = "please use `Uint::checked_mul(_int)` instead")]
8787
pub fn checked_mul_uint_right<const RHS_LIMBS: usize>(
8888
&self,

src/int/resize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{Int, Limb, Uint};
22

33
impl<const LIMBS: usize> Int<LIMBS> {
4-
/// Resize the representation of `self` to an `Int<T>`.
4+
/// Resize the representation of `self` to an [`Int<T>`].
55
/// Warning: this operation may lead to loss of information.
66
#[inline(always)]
77
pub const fn resize<const T: usize>(&self) -> Int<T> {

src/int/sub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use subtle::CtOption;
88
use crate::{Checked, CheckedSub, ConstChoice, ConstCtOption, Int, Wrapping};
99

1010
impl<const LIMBS: usize> Int<LIMBS> {
11-
/// Perform subtraction, returning the result along with a [ConstChoice] which `is_true`
11+
/// Perform subtraction, returning the result along with a [`ConstChoice`] which `is_true`
1212
/// only if the operation underflowed.
1313
pub const fn underflowing_sub(&self, rhs: &Self) -> (Self, ConstChoice) {
1414
// Step 1. subtract operands

src/modular/bingcd/extension.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub(crate) struct ExtendedUint<const LIMBS: usize, const EXTENSION_LIMBS: usize>
66
);
77

88
impl<const LIMBS: usize, const EXTRA: usize> ExtendedUint<LIMBS, EXTRA> {
9-
/// Construct an [ExtendedUint] from the product of a [Uint<LIMBS>] and an [Uint<EXTRA>].
9+
/// Construct an [`ExtendedUint`] from the product of a [`Uint<LIMBS>`] and an [`Uint<EXTRA>`].
1010
///
1111
/// Assumes the top bit of the product is not set.
1212
#[inline]
@@ -15,7 +15,7 @@ impl<const LIMBS: usize, const EXTRA: usize> ExtendedUint<LIMBS, EXTRA> {
1515
ExtendedUint(lo, hi)
1616
}
1717

18-
/// Interpret `self` as an [ExtendedInt]
18+
/// Interpret `self` as an [`ExtendedInt`]
1919
#[inline]
2020
pub const fn as_extended_int(&self) -> ExtendedInt<LIMBS, EXTRA> {
2121
ExtendedInt(self.0, self.1)
@@ -106,15 +106,15 @@ pub(crate) struct ExtendedInt<const LIMBS: usize, const EXTENSION_LIMBS: usize>(
106106
);
107107

108108
impl<const LIMBS: usize, const EXTRA: usize> ExtendedInt<LIMBS, EXTRA> {
109-
/// Construct an [ExtendedInt] from the product of a [Uint<LIMBS>] and an [Int<EXTRA>].
109+
/// Construct an [`ExtendedInt`] from the product of a [`Uint<LIMBS>`] and a [`Uint<EXTRA>`].
110110
///
111111
/// Assumes the top bit of the product is not set.
112112
#[inline]
113113
pub const fn from_product(lhs: Uint<LIMBS>, rhs: Uint<EXTRA>) -> Self {
114114
ExtendedUint::from_product(lhs, rhs).as_extended_int()
115115
}
116116

117-
/// Interpret this as an [ExtendedUint].
117+
/// Interpret this as an [`ExtendedUint`].
118118
#[inline]
119119
pub const fn as_extended_uint(&self) -> ExtendedUint<LIMBS, EXTRA> {
120120
ExtendedUint(self.0, self.1)

src/modular/bingcd/gcd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ impl<const LIMBS: usize> Odd<Uint<LIMBS>> {
9292
/// - `K`: the number of bits used when summarizing `self` and `rhs` for the inner loop. The
9393
/// `K+1` top bits and `K-1` least significant bits are selected. It is recommended to keep
9494
/// `K` close to a (multiple of) the number of bits that fit in a single register.
95-
/// - `LIMBS_K`: should be chosen as the minimum number s.t. `Uint::<LIMBS>::BITS ≥ K`,
96-
/// - `LIMBS_2K`: should be chosen as the minimum number s.t. `Uint::<LIMBS>::BITS ≥ 2K`.
95+
/// - `LIMBS_K`: should be chosen as the minimum number s.t. [`Uint::<LIMBS>::BITS`] `≥ K`,
96+
/// - `LIMBS_2K`: should be chosen as the minimum number s.t. [`Uint::<LIMBS>::BITS`] `≥ 2K`.
9797
#[inline]
9898
pub const fn optimized_bingcd_<const K: u32, const LIMBS_K: usize, const LIMBS_2K: usize>(
9999
&self,

src/uint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl<const LIMBS: usize> Uint<LIMBS> {
222222
}
223223
}
224224

225-
/// Convert this type into an [`Int`]; returns `None` if this value is greater than `Int::MAX`.
225+
/// Convert this type into an [`Int`]; returns `None` if this value is greater than [`Int::MAX`].
226226
///
227227
/// Note: this is the conversion operation. See [`Self::as_int`] for the unchecked equivalent.
228228
pub const fn try_into_int(self) -> ConstCtOption<Int<LIMBS>> {

src/uint/ref_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::Word;
1111

1212
/// Unsigned integer reference type.
1313
///
14-
/// This type contains a limb slice which can be borrowed from either a `Uint` or `BoxedUint` and
14+
/// This type contains a limb slice which can be borrowed from either a [`Uint`] or [`BoxedUint`] and
1515
/// thus provides an abstraction for writing shared implementations.
1616
#[repr(transparent)]
1717
pub(crate) struct UintRef(pub [Limb]);

0 commit comments

Comments
 (0)