Skip to content

Commit a8f272e

Browse files
committed
fix: resolve rolegraph example clippy failures in CI
1 parent 4b464a8 commit a8f272e

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

crates/terraphim_rolegraph/examples/graph_embeddings_tutorial.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use terraphim_types::{
4242
/// When you search for "consensus algorithms", the graph traverses from the
4343
/// matched node to connected nodes, finding documents that mention related
4444
/// concepts like "raft", "leader election", etc.
45-
45+
///
4646
/// Build the initial thesaurus (basic learning concepts)
4747
fn build_initial_thesaurus() -> Thesaurus {
4848
let mut thesaurus = Thesaurus::new("Initial Learnings".to_string());
@@ -129,7 +129,7 @@ fn build_enhanced_thesaurus() -> Thesaurus {
129129
/// PART 2: Sample Learning Documents
130130
/// ============================================================================
131131
/// These represent notes captured from technical books, courses, and research.
132-
132+
///
133133
fn create_learning_documents() -> Vec<Document> {
134134
vec![
135135
Document {
@@ -247,7 +247,7 @@ Prevents use-after-free, double-free, and data races."#
247247
/// ============================================================================
248248
/// PART 3: Demonstrating Graph Embedding and Indexing
249249
/// ============================================================================
250-
250+
///
251251
async fn demonstrate_embedding(
252252
rolegraph: &mut RoleGraph,
253253
docs: &[Document],
@@ -292,7 +292,7 @@ async fn demonstrate_embedding(
292292
/// ============================================================================
293293
/// This is the key demonstration: how adding domain-specific terms improves
294294
/// retrieval quality.
295-
295+
///
296296
async fn compare_rankings(
297297
initial_graph: &RoleGraph,
298298
enhanced_graph: &RoleGraph,
@@ -372,7 +372,7 @@ async fn compare_rankings(
372372
/// PART 5: Connectivity Analysis
373373
/// ============================================================================
374374
/// Shows how graph connectivity indicates semantic coherence
375-
375+
///
376376
fn demonstrate_connectivity(rolegraph: &RoleGraph, queries: &[&str]) {
377377
println!("\n🕸️ Semantic Connectivity Analysis");
378378
println!(" (Checks if query terms are connected in the knowledge graph)");

crates/terraphim_rolegraph/examples/learning_via_negativa.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
//! 2. Create correction knowledge graph (wrong -> right)
1717
//! 3. Use replace tool to suggest corrections
1818
19-
use std::collections::HashMap;
2019
use terraphim_rolegraph::RoleGraph;
2120
use terraphim_types::{
2221
Document, DocumentType, NormalizedTerm, NormalizedTermValue, RoleName, Thesaurus,
@@ -314,6 +313,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
314313
println!("\n📝 Captured Failed Command:");
315314
println!(" Wrong: {}", failed.wrong_command);
316315
println!(" Error: {}", failed.error_output);
316+
println!(" Correct: {}", failed.correct_command);
317317
println!(" Context: {}", failed.context);
318318

319319
// Build correction knowledge graphs
@@ -368,7 +368,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
368368
println!(" Initial: No correction found");
369369
} else {
370370
println!(" Initial: {} results", initial_results.len());
371-
for (doc_id, doc) in initial_results.iter().take(1) {
371+
for (doc_id, _doc) in initial_results.iter().take(1) {
372372
println!(" -> {}", doc_id);
373373
}
374374
}
@@ -394,6 +394,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
394394
}
395395
}
396396

397+
demonstrate_correction(&enhanced_graph, &failed.wrong_command).await;
398+
397399
// Summary
398400
println!("\n================================================================================");
399401
println!(" Summary: Learning via Negativa");

0 commit comments

Comments
 (0)