Skip to content

Commit 76c9e75

Browse files
committed
Fixing build errors
1 parent a5f3584 commit 76c9e75

18 files changed

+56
-42
lines changed

crates/cli/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub enum Commands {
6060
},
6161
}
6262

63-
#[derive(clap::ValueEnum, Clone)]
63+
#[derive(clap::ValueEnum, Clone, Debug)]
6464
pub enum OutputFormat {
6565
Text,
6666
Json,

crates/cli/src/output.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
use colored::*;
44
use serde_json;
55

6+
#[allow(dead_code)]
67
pub struct OutputFormatter;
78

89
impl OutputFormatter {
10+
#[allow(dead_code)]
911
pub fn format_diff_text(changes: &[String]) -> String {
1012
let mut output = String::new();
1113

@@ -22,10 +24,12 @@ impl OutputFormatter {
2224
output
2325
}
2426

27+
#[allow(dead_code)]
2528
pub fn format_diff_json(changes: &[String]) -> Result<String, serde_json::Error> {
2629
serde_json::to_string_pretty(changes)
2730
}
2831

32+
#[allow(dead_code)]
2933
pub fn format_diff_html(changes: &[String]) -> String {
3034
let mut html = String::from("<div class=\"diff\">\n");
3135

crates/diff-engine/src/changes.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Change classification and analysis
22
3-
use serde::{Deserialize, Serialize};
4-
use smart_diff_parser::{Change, ChangeType, CodeElement};
3+
use smart_diff_parser::{ChangeType, CodeElement};
54

65
/// Change classifier that categorizes detected changes
76
pub struct ChangeClassifier;

crates/diff-engine/src/engine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use thiserror::Error;
1111
/// Main diff engine that orchestrates the comparison process
1212
pub struct DiffEngine {
1313
function_matcher: FunctionMatcher,
14+
#[allow(dead_code)]
1415
tree_edit_distance: TreeEditDistance,
16+
#[allow(dead_code)]
1517
change_classifier: ChangeClassifier,
1618
refactoring_detector: RefactoringDetector,
1719
}

crates/diff-engine/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ pub mod similarity_scorer;
1111
pub mod tree_edit;
1212

1313
pub use changes::ChangeClassifier;
14-
pub use smart_diff_parser::{Change, ChangeType};
1514
pub use engine::{DiffEngine, DiffError, DiffResult};
1615
pub use matching::{FunctionMatcher, SimilarityScore};
17-
pub use smart_diff_parser::MatchResult;
1816
pub use refactoring::{RefactoringDetector, RefactoringPattern};
1917
pub use similarity_scorer::{
2018
ASTSimilarityScore, ComprehensiveSimilarityScore, ContextSimilarityScore,
2119
DetailedSimilarityBreakdown, MatchType, SemanticSimilarityMetrics, SimilarityFactor,
2220
SimilarityScorer, SimilarityScoringConfig,
2321
};
22+
pub use smart_diff_parser::MatchResult;
23+
pub use smart_diff_parser::{Change, ChangeType};
2424
pub use tree_edit::{EditCost, EditOperation, TreeEditDistance};
2525

2626
/// Re-export commonly used types

crates/diff-engine/src/matching.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use serde::{Deserialize, Serialize};
44
use smart_diff_parser::{Function, MatchResult};
5-
use std::collections::HashMap;
65

76
/// Function matcher that finds optimal mappings between function sets
87
pub struct FunctionMatcher {

crates/diff-engine/src/refactoring.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ impl RefactoringDetector {
3636
patterns
3737
}
3838

39-
fn detect_extract_method(&self, changes: &[Change]) -> Vec<RefactoringPattern> {
39+
fn detect_extract_method(&self, _changes: &[Change]) -> Vec<RefactoringPattern> {
4040
// Look for patterns where code is removed from one function and added to a new function
4141
Vec::new() // Placeholder
4242
}
4343

44-
fn detect_rename_patterns(&self, changes: &[Change]) -> Vec<RefactoringPattern> {
44+
fn detect_rename_patterns(&self, _changes: &[Change]) -> Vec<RefactoringPattern> {
4545
// Look for rename patterns
4646
Vec::new() // Placeholder
4747
}
4848

49-
fn detect_move_patterns(&self, changes: &[Change]) -> Vec<RefactoringPattern> {
49+
fn detect_move_patterns(&self, _changes: &[Change]) -> Vec<RefactoringPattern> {
5050
// Look for move patterns
5151
Vec::new() // Placeholder
5252
}

crates/diff-engine/src/similarity_scorer.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use serde::{Deserialize, Serialize};
66
use smart_diff_parser::{ASTNode, Language, NodeType};
77
use smart_diff_semantic::{
88
EnhancedFunctionSignature, FunctionSignatureExtractor, FunctionSignatureSimilarity,
9-
TypeEquivalence,
109
};
1110
use std::collections::{HashMap, HashSet};
1211

@@ -52,6 +51,7 @@ impl Default for SimilarityScoringConfig {
5251
/// Comprehensive similarity scorer
5352
pub struct SimilarityScorer {
5453
config: SimilarityScoringConfig,
54+
#[allow(dead_code)]
5555
language: Language,
5656
signature_extractor: FunctionSignatureExtractor,
5757
tree_edit_calculator: TreeEditDistance,
@@ -190,6 +190,7 @@ struct ContextInfo {
190190
function_calls: HashSet<String>,
191191
variable_names: HashSet<String>,
192192
type_usage: HashSet<String>,
193+
#[allow(dead_code)]
193194
control_flow_patterns: Vec<String>,
194195
dependencies: HashSet<String>,
195196
}
@@ -601,7 +602,7 @@ impl SimilarityScorer {
601602
self.calculate_set_similarity(&context1.dependencies, &context2.dependencies);
602603

603604
// Type usage similarity
604-
let type_usage_similarity =
605+
let _type_usage_similarity =
605606
self.calculate_set_similarity(&context1.type_usage, &context2.type_usage);
606607

607608
// Surrounding code similarity (based on class/namespace context)
@@ -1115,9 +1116,9 @@ impl SimilarityScorer {
11151116
context_similarity: &ContextSimilarityScore,
11161117
) -> f64 {
11171118
// Base confidence from overall similarities
1118-
let base_confidence = (signature_similarity.overall_similarity * 0.4
1119+
let base_confidence = signature_similarity.overall_similarity * 0.4
11191120
+ body_similarity.overall_similarity * 0.4
1120-
+ context_similarity.overall_similarity * 0.2);
1121+
+ context_similarity.overall_similarity * 0.2;
11211122

11221123
// Boost confidence for exact matches
11231124
let exact_match_bonus = if signature_similarity.similarity_breakdown.exact_name_match {
@@ -1153,9 +1154,9 @@ impl SimilarityScorer {
11531154
/// Build detailed similarity breakdown
11541155
fn build_detailed_breakdown(
11551156
&self,
1156-
func1_signature: &EnhancedFunctionSignature,
1157+
_func1_signature: &EnhancedFunctionSignature,
11571158
func1_ast: &ASTNode,
1158-
func2_signature: &EnhancedFunctionSignature,
1159+
_func2_signature: &EnhancedFunctionSignature,
11591160
func2_ast: &ASTNode,
11601161
signature_similarity: &FunctionSignatureSimilarity,
11611162
body_similarity: &ASTSimilarityScore,

crates/diff-engine/src/tree_edit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl TreeEditDistance {
8181
}
8282

8383
/// Calculate edit operations to transform tree1 into tree2
84-
pub fn calculate_operations(&self, tree1: &ASTNode, tree2: &ASTNode) -> Vec<EditOperation> {
84+
pub fn calculate_operations(&self, _tree1: &ASTNode, _tree2: &ASTNode) -> Vec<EditOperation> {
8585
// Placeholder implementation
8686
// Would return the sequence of operations needed for transformation
8787
Vec::new()

crates/semantic-analysis/src/analyzer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl SemanticAnalyzer {
5151
/// Analyze a parsed file
5252
pub fn analyze(&mut self, parse_result: &ParseResult) -> Result<AnalysisResult, AnalysisError> {
5353
let mut errors = Vec::new();
54-
let mut warnings = Vec::new();
54+
let warnings = Vec::new();
5555

5656
// First pass: collect symbols and types
5757
if let Err(e) = self.collect_symbols(&parse_result.ast, &parse_result.language.to_string())
@@ -78,19 +78,19 @@ impl SemanticAnalyzer {
7878
})
7979
}
8080

81-
fn collect_symbols(&mut self, ast: &ASTNode, file_path: &str) -> Result<(), AnalysisError> {
81+
fn collect_symbols(&mut self, _ast: &ASTNode, _file_path: &str) -> Result<(), AnalysisError> {
8282
// TODO: Implement symbol collection
8383
// This would traverse the AST and populate the symbol table
8484
Ok(())
8585
}
8686

87-
fn resolve_references(&mut self, ast: &ASTNode) -> Result<(), AnalysisError> {
87+
fn resolve_references(&mut self, _ast: &ASTNode) -> Result<(), AnalysisError> {
8888
// TODO: Implement reference resolution
8989
// This would find all symbol references and link them to declarations
9090
Ok(())
9191
}
9292

93-
fn check_types(&mut self, ast: &ASTNode) -> Result<(), AnalysisError> {
93+
fn check_types(&mut self, _ast: &ASTNode) -> Result<(), AnalysisError> {
9494
// TODO: Implement type checking
9595
// This would verify type compatibility and catch type errors
9696
Ok(())

0 commit comments

Comments
 (0)