Skip to content

Commit 2ae7cdd

Browse files
committed
Fix formatting and spelling issues
- Format if-else on single line in pollard_rho.rs per rustfmt - Add missing technical terms to cspell dictionary: coeff, Lenstra's, modpow, mult
1 parent 52d1aa4 commit 2ae7cdd

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.vscode/cspell.dictionaries/jargon.wordlist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,14 @@ accum
208208
biguint
209209
BSGS
210210
bsgs
211+
coeff
211212
coprimes
212213
funcs
213214
Lehmer
215+
Lenstra's
216+
modpow
214217
montg
218+
mult
215219
mulmod
216220
newr
217221
powmod

src/uu/factor/src/crypto_bigint_adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub struct FastU64Modulus {
128128

129129
impl FastU64Modulus {
130130
pub fn new(modulus: u64) -> Self {
131-
FastU64Modulus { modulus }
131+
Self { modulus }
132132
}
133133

134134
/// Ultra-fast modular multiplication for u64

src/uu/factor/src/ecm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ fn generate_random_curve(n: &BigUint) -> Option<(EllipticCurveParams, PointProje
505505
generate_seeded_curve(n, &mut rng)
506506
}
507507

508+
#[allow(clippy::many_single_char_names)]
508509
fn generate_seeded_curve<R: rand::Rng>(
509510
n: &BigUint,
510511
rng: &mut R,

src/uu/factor/src/pollard_rho.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ fn brent_cycle_find(
117117
}
118118

119119
/// Standard Brent's cycle-finding without Montgomery form
120+
#[allow(clippy::many_single_char_names)]
120121
fn brent_cycle_find_standard(
121122
x0: &BigUint,
122123
c: &BigUint,
@@ -136,11 +137,7 @@ fn brent_cycle_find_standard(
136137
x = f(&x, c, n);
137138

138139
// Accumulate differences for batch GCD
139-
let diff = if x > y {
140-
(&x - &y) % n
141-
} else {
142-
(&y - &x) % n
143-
};
140+
let diff = if x > y { (&x - &y) % n } else { (&y - &x) % n };
144141

145142
if diff != BigUint::zero() {
146143
q = (&q * &diff) % n;
@@ -163,6 +160,7 @@ fn brent_cycle_find_standard(
163160

164161
/// Brent's cycle-finding with Montgomery form arithmetic
165162
/// All arithmetic done in Montgomery form for 3-5x speedup
163+
#[allow(clippy::many_single_char_names)]
166164
fn brent_cycle_find_montgomery(
167165
x0: &BigUint,
168166
c: &BigUint,

src/uu/factor/src/trial_division.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ impl FactorizationCache {
217217

218218
/// Number analysis for optimization selection
219219
#[derive(Debug, Clone)]
220+
#[allow(dead_code)]
220221
pub struct NumberProfile {
221222
pub bit_length: usize,
222223
pub has_small_factors: bool,
@@ -225,6 +226,7 @@ pub struct NumberProfile {
225226

226227
impl NumberProfile {
227228
/// Analyze a number for optimization hints
229+
#[allow(dead_code)]
228230
pub fn analyze(n: &BigUint) -> Self {
229231
let bit_length = n.bits() as usize;
230232
let is_even = n.is_even();

0 commit comments

Comments
 (0)