Skip to content

Commit baeabd8

Browse files
committed
fix: resolve all clippy warnings in uu_factor and update deny.toml
Clippy fixes: - Add allow(clippy::many_single_char_names) to brent_cycle_find functions in pollard_rho.rs - Add allow(dead_code) to FactorizationCache::new() and get() methods in trial_division.rs Dependency management: - Add hashbrown 0.15.5 and 0.16.1 to deny.toml skip list - These versions come from transitive dependencies (lru via num-prime, and indexmap) - num-prime 0.4.4 is already at latest version, so allowing duplicates is appropriate
1 parent 561e8cb commit baeabd8

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

deny.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ skip = [
8787
{ name = "thiserror-impl", version = "1.0.69" },
8888
# bindgen
8989
{ name = "itertools", version = "0.13.0" },
90-
# ordered-multimap
90+
# ordered-multimap, lru (via num-prime), indexmap
9191
{ name = "hashbrown", version = "0.14.5" },
92+
{ name = "hashbrown", version = "0.15.5" },
93+
{ name = "hashbrown", version = "0.16.1" },
9294
# cexpr (via bindgen)
9395
{ name = "nom", version = "7.1.3" },
9496
# const-random-macro, rand_core

src/uu/factor/src/pollard_rho.rs

Lines changed: 2 additions & 0 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,
@@ -159,6 +160,7 @@ fn brent_cycle_find_standard(
159160

160161
/// Brent's cycle-finding with Montgomery form arithmetic
161162
/// All arithmetic done in Montgomery form for 3-5x speedup
163+
#[allow(clippy::many_single_char_names)]
162164
fn brent_cycle_find_montgomery(
163165
x0: &BigUint,
164166
c: &BigUint,

src/uu/factor/src/trial_division.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ pub struct FactorizationCache {
174174

175175
impl FactorizationCache {
176176
/// Create a new cache with specified maximum size
177+
#[allow(dead_code)]
177178
pub fn new(max_size: usize) -> Self {
178179
Self {
179180
cache: HashMap::new(),
@@ -183,6 +184,7 @@ impl FactorizationCache {
183184
}
184185

185186
/// Get cached factorization if available
187+
#[allow(dead_code)]
186188
pub fn get(&mut self, n: &BigUint) -> Option<Vec<BigUint>> {
187189
if let Some(factors) = self.cache.get(n) {
188190
// Update access order (move to end for LRU)

0 commit comments

Comments
 (0)