Skip to content

Commit 75232b6

Browse files
mivertowskiclaude
andcommitted
fix: resolve all compiler warnings for clean build
- Remove duplicate PageRankOp/Request/Response types from centrality.rs (already defined in messages.rs, causing ambiguous glob re-exports) - Remove unused serde imports from centrality.rs - Remove unused HashMap import from paths.rs - Replace deprecated gen_bool with random_bool in explainability.rs - Remove unused neighbors_u variable in cycles.rs - Fix unused edges assignment in motif.rs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 511cd69 commit 75232b6

5 files changed

Lines changed: 3 additions & 46 deletions

File tree

crates/rustkernel-graph/src/centrality.rs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,53 +24,13 @@ use rustkernel_core::{
2424
kernel::KernelMetadata,
2525
traits::{BatchKernel, GpuKernel, RingKernelHandler},
2626
};
27-
use serde::{Deserialize, Serialize};
2827
use std::collections::VecDeque;
2928
use std::time::Instant;
3029

3130
// ============================================================================
3231
// PageRank Kernel
3332
// ============================================================================
3433

35-
/// PageRank operation type.
36-
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
37-
pub enum PageRankOp {
38-
/// Query the current PageRank score for a node.
39-
Query,
40-
/// Perform one iteration of PageRank.
41-
Iterate,
42-
/// Reset all scores.
43-
Reset,
44-
/// Initialize with a graph.
45-
Initialize,
46-
}
47-
48-
/// PageRank request.
49-
#[derive(Debug, Clone, Serialize, Deserialize)]
50-
pub struct PageRankRequest {
51-
/// Node ID to query (for Query operation).
52-
pub node_id: Option<u64>,
53-
/// Operation type.
54-
pub operation: PageRankOp,
55-
/// Graph data (for Initialize operation).
56-
pub graph: Option<CsrGraph>,
57-
/// Damping factor (default: 0.85).
58-
pub damping: Option<f32>,
59-
}
60-
61-
/// PageRank response.
62-
#[derive(Debug, Clone, Serialize, Deserialize)]
63-
pub struct PageRankResponse {
64-
/// Score for the queried node.
65-
pub score: Option<f64>,
66-
/// Whether the algorithm has converged.
67-
pub converged: bool,
68-
/// Current iteration count.
69-
pub iteration: u32,
70-
/// Full result (for Query after convergence).
71-
pub result: Option<CentralityResult>,
72-
}
73-
7434
/// PageRank kernel state.
7535
#[derive(Debug, Clone, Default)]
7636
pub struct PageRankState {

crates/rustkernel-graph/src/cycles.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ impl ShortCycleParticipation {
8686

8787
// For each edge, check if reciprocal exists
8888
for u in 0..n {
89-
let neighbors_u: HashSet<u64> = graph.neighbors(u as u64).iter().copied().collect();
90-
9189
for &v in graph.neighbors(u as u64) {
9290
// Check if edge v -> u exists (reciprocal)
9391
if graph.neighbors(v).contains(&(u as u64)) {

crates/rustkernel-graph/src/motif.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ impl MotifDetection {
196196
let n = graph.num_nodes;
197197
let mut triangles = 0u64;
198198
let mut wedges = 0u64;
199-
let mut edges = 0u64;
200199

201200
// Count triangles and wedges
202201
for u in 0..n {
@@ -226,7 +225,7 @@ impl MotifDetection {
226225
triangles /= 3;
227226

228227
// Edges count
229-
edges = graph.num_edges as u64 / 2; // Undirected edges
228+
let edges = graph.num_edges as u64 / 2; // Undirected edges
230229

231230
let mut motif_counts = std::collections::HashMap::new();
232231
motif_counts.insert("triangles".to_string(), triangles);

crates/rustkernel-graph/src/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use crate::types::CsrGraph;
99
use rustkernel_core::{domain::Domain, kernel::KernelMetadata, traits::GpuKernel};
1010
use std::cmp::Ordering;
11-
use std::collections::{BinaryHeap, HashMap, VecDeque};
11+
use std::collections::{BinaryHeap, VecDeque};
1212

1313
// ============================================================================
1414
// Shortest Path Results

crates/rustkernel-ml/src/explainability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl SHAPValues {
190190

191191
// Sample random coalitions
192192
for _ in 2..n_samples {
193-
let coalition: Vec<bool> = (0..n_features).map(|_| rng.gen_bool(0.5)).collect();
193+
let coalition: Vec<bool> = (0..n_features).map(|_| rng.random_bool(0.5)).collect();
194194

195195
let z: usize = coalition.iter().filter(|&&b| b).count();
196196
let weight = Self::kernel_shap_weight(n_features, z);

0 commit comments

Comments
 (0)