@@ -5,7 +5,6 @@ use std::{fs, process};
55use anyhow:: Result ;
66use clap:: Parser ;
77use ignore:: Walk ;
8- use imara_diff:: { Algorithm , BasicLineDiffPrinter , Diff , InternedInput , UnifiedDiffConfig } ;
98use regex:: Regex ;
109
1110#[ derive( Parser ) ]
@@ -18,8 +17,6 @@ struct Cli {
1817 /// Applies to lines that are to be split
1918 #[ arg( long, default_value_t = 100 ) ]
2019 line_length_limit : usize ,
21- #[ arg( long) ]
22- show_diff : bool ,
2320}
2421
2522static REGEX_IGNORE_END : LazyLock < Regex > =
@@ -54,10 +51,6 @@ fn main() -> Result<()> {
5451 } else if cli. overwrite {
5552 fs:: write ( & path, new) ?;
5653 made_compliant. push ( path. clone ( ) ) ;
57- } else if cli. show_diff {
58- println ! ( "{}:" , path. display( ) ) ;
59- show_diff ( & old, & new) ;
60- println ! ( "---" ) ;
6154 } else {
6255 not_compliant. push ( path. clone ( ) ) ;
6356 }
@@ -76,16 +69,6 @@ fn main() -> Result<()> {
7669 Ok ( ( ) )
7770}
7871
79- fn show_diff ( old : & str , new : & str ) {
80- let input = InternedInput :: new ( old, new) ;
81- let mut diff = Diff :: compute ( Algorithm :: Histogram , & input) ;
82- diff. postprocess_lines ( & input) ;
83- let diff = diff
84- . unified_diff ( & BasicLineDiffPrinter ( & input. interner ) , UnifiedDiffConfig :: default ( ) , & input)
85- . to_string ( ) ;
86- print ! ( "{diff}" ) ;
87- }
88-
8972fn display ( header : & str , paths : & [ PathBuf ] ) {
9073 println ! ( "{header}:" ) ;
9174 for element in paths {
0 commit comments