@@ -13,23 +13,22 @@ use smart_diff_engine::{
1313 SimilarityScorer , ChangeClassifier , CrossFileTracker
1414} ;
1515use std:: collections:: HashMap ;
16- use std:: fs;
1716use std:: path:: { Path , PathBuf } ;
1817use std:: time:: { Instant , Duration } ;
1918use tokio:: fs as async_fs;
20- use tracing:: { info, warn, error , debug} ;
19+ use tracing:: { info, warn, debug} ;
2120
2221pub async fn run ( cli : Cli ) -> Result < ( ) > {
2322 if let Commands :: Compare {
24- source,
25- target,
26- format,
23+ ref source,
24+ ref target,
25+ ref format,
2726 recursive,
2827 ignore_whitespace,
2928 ignore_case,
3029 threshold,
31- output,
32- language,
30+ ref output,
31+ ref language,
3332 detect_refactoring,
3433 track_moves,
3534 show_similarity,
@@ -403,10 +402,10 @@ async fn process_file_pair(
403402 . with_context ( || format ! ( "Failed to analyze target file: {}" , target_file. display( ) ) ) ?;
404403
405404 // Initialize diff engine components
406- let mut diff_engine = DiffEngine :: new ( ) ;
405+ let diff_engine = DiffEngine :: new ( ) ;
407406
408407 // Configure similarity scorer
409- let mut similarity_scorer = SimilarityScorer :: new ( detected_language, smart_diff_engine:: SimilarityScoringConfig :: default ( ) ) ;
408+ let similarity_scorer = SimilarityScorer :: new ( detected_language, smart_diff_engine:: SimilarityScoringConfig :: default ( ) ) ;
410409 if ignore_whitespace {
411410 // Configure to ignore whitespace - would need to add this to SimilarityScorer
412411 debug ! ( "Ignoring whitespace in similarity calculation" ) ;
@@ -460,6 +459,8 @@ async fn process_file_pair(
460459 description : "Change detected" . to_string ( ) ,
461460 alternatives : Vec :: new ( ) ,
462461 complexity_score : 0.5 ,
462+ characteristics : Vec :: new ( ) ,
463+ evidence : Vec :: new ( ) ,
463464 } ,
464465 secondary_types : Vec :: new ( ) ,
465466 similarity_metrics : None ,
@@ -544,7 +545,7 @@ fn calculate_function_similarities(
544545 target_symbols : & SymbolTable ,
545546 similarity_scorer : & SimilarityScorer ,
546547) -> Result < HashMap < String , f64 > > {
547- let mut similarities = HashMap :: new ( ) ;
548+ let similarities: HashMap < String , f64 > = HashMap :: new ( ) ;
548549
549550 // Would need to iterate over functions from symbol table - simplified for now
550551 let similarities = HashMap :: new ( ) ;
@@ -641,7 +642,7 @@ fn display_summary(
641642
642643 let status = if result. diff_result . match_result . changes . is_empty ( ) {
643644 "No changes" . green ( )
644- } else if result. diff_result . changes . len ( ) < 5 {
645+ } else if result. diff_result . match_result . changes . len ( ) < 5 {
645646 "Minor changes" . yellow ( )
646647 } else {
647648 "Major changes" . red ( )
@@ -650,7 +651,7 @@ fn display_summary(
650651 term. write_line ( & format ! ( " {} - {} ({} changes, {:.1}% similar)" ,
651652 file_name,
652653 status,
653- result. diff_result. changes. len( ) ,
654+ result. diff_result. match_result . changes. len( ) ,
654655 result. stats. similarity_score * 100.0
655656 ) ) ?;
656657 }
@@ -702,7 +703,7 @@ fn format_duration(duration: Duration) -> String {
702703
703704/// Extract functions from AST for comparison
704705fn extract_functions_from_ast ( ast : & smart_diff_parser:: ASTNode ) -> Vec < smart_diff_parser:: Function > {
705- use smart_diff_parser:: { Function , FunctionSignature , Parameter , Type , NodeType } ;
706+ use smart_diff_parser:: { Function , FunctionSignature , NodeType } ;
706707
707708 let mut functions = Vec :: new ( ) ;
708709
@@ -717,7 +718,7 @@ fn extract_functions_from_ast(ast: &smart_diff_parser::ASTNode) -> Vec<smart_dif
717718 let signature = FunctionSignature {
718719 name : name. clone ( ) ,
719720 parameters : Vec :: new ( ) , // Simplified for now
720- return_type : smart_diff_parser:: Type :: Primitive ( "void" . to_string ( ) ) ,
721+ return_type : Some ( smart_diff_parser:: Type :: new ( "void" . to_string ( ) ) ) ,
721722 modifiers : Vec :: new ( ) ,
722723 generic_parameters : Vec :: new ( ) ,
723724 } ;
@@ -733,7 +734,7 @@ fn extract_functions_from_ast(ast: &smart_diff_parser::ASTNode) -> Vec<smart_dif
733734 end_column : node. metadata . column ,
734735 } ,
735736 dependencies : Vec :: new ( ) ,
736- hash : 0 , // Simplified for now
737+ hash : "0" . to_string ( ) , // Simplified for now
737738 } ;
738739
739740 functions. push ( function) ;
0 commit comments