Skip to content

Commit 57ca461

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 57ca461

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

.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/fermat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ use num_traits::{One, Zero};
2626
/// `Some(factor)` if successful, `None` if limit exceeded
2727
///
2828
/// # Example
29-
/// ```
30-
/// # use uu_factor::fermat::fermat_factor_u64;
29+
/// ```ignore
3130
/// let n = 4295049777u64; // 65521 × 65537
3231
/// let factor = fermat_factor_u64(n).unwrap();
3332
/// assert!(n % factor == 0);

src/uu/factor/src/pollard_rho.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ fn brent_cycle_find_standard(
136136
x = f(&x, c, n);
137137

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

145141
if diff != BigUint::zero() {
146142
q = (&q * &diff) % n;

src/uu/factor/src/u64_factor.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
//!
88
//! Uses hand-tuned operations for maximum performance
99
10-
use num_bigint::BigUint;
11-
use num_integer::gcd;
12-
use num_traits::{One, ToPrimitive, Zero};
13-
1410
/// Fast Pollard-Rho for u64 numbers using Brent's algorithm
1511
#[inline]
1612
pub fn pollard_rho_brent_u64(n: u64) -> Option<u64> {

0 commit comments

Comments
 (0)