@@ -88,7 +88,7 @@ impl<'a> FileDiff<'a> {
88
88
89
89
if path1_file_type. is_file ( ) {
90
90
let path1_file = path1. clone ( ) ;
91
- let path1_file = path1_file. file_name ( ) . expect ( & COULD_NOT_UNWRAP_FILENAME ) ;
91
+ let path1_file = path1_file. file_name ( ) . expect ( COULD_NOT_UNWRAP_FILENAME ) ;
92
92
let path2 = path2. join ( path1_file) ;
93
93
94
94
if !check_existance ( & path2) ? {
@@ -98,7 +98,7 @@ impl<'a> FileDiff<'a> {
98
98
return FileDiff :: file_diff ( path1, path2, format_options, None ) ;
99
99
} else {
100
100
let path2_file = path2. clone ( ) ;
101
- let path2_file = path2_file. file_name ( ) . expect ( & COULD_NOT_UNWRAP_FILENAME ) ;
101
+ let path2_file = path2_file. file_name ( ) . expect ( COULD_NOT_UNWRAP_FILENAME ) ;
102
102
let path1 = path1. join ( path2_file) ;
103
103
104
104
if !check_existance ( & path1) ? {
@@ -151,22 +151,22 @@ impl<'a> FileDiff<'a> {
151
151
for hunk_index in 0 ..hunks_count {
152
152
let hunk = self . hunks . hunk_at_mut ( hunk_index) ;
153
153
match self . format_options . output_format {
154
- OutputFormat :: Debug => hunk. print_debug ( & self . file1 , & self . file2 ) ,
154
+ OutputFormat :: Debug => hunk. print_debug ( self . file1 , self . file2 ) ,
155
155
OutputFormat :: Default => {
156
- hunk. print_default ( & self . file1 , & self . file2 , hunk_index == hunks_count - 1 )
156
+ hunk. print_default ( self . file1 , self . file2 , hunk_index == hunks_count - 1 )
157
157
}
158
158
OutputFormat :: EditScript => hunk. print_edit_script (
159
- & self . file1 ,
160
- & self . file2 ,
159
+ self . file1 ,
160
+ self . file2 ,
161
161
hunk_index == hunks_count - 1 ,
162
162
) ,
163
163
OutputFormat :: Context ( _) => {
164
164
eprintln ! ( "OutputFormat::Context should be handled in other place" ) ;
165
165
return Ok ( DiffExitStatus :: Trouble ) ;
166
166
}
167
167
OutputFormat :: ForwardEditScript => hunk. print_forward_edit_script (
168
- & self . file1 ,
169
- & self . file2 ,
168
+ self . file1 ,
169
+ self . file2 ,
170
170
hunk_index == hunks_count - 1 ,
171
171
) ,
172
172
OutputFormat :: Unified ( _) => {
@@ -209,7 +209,7 @@ impl<'a> FileDiff<'a> {
209
209
210
210
for i in 1 ..=n {
211
211
for j in 1 ..=m {
212
- let cost = if self . compare_lines ( & self . file1 . line ( i - 1 ) , & self . file2 . line ( j - 1 ) ) {
212
+ let cost = if self . compare_lines ( self . file1 . line ( i - 1 ) , self . file2 . line ( j - 1 ) ) {
213
213
if !file1_considered_lines. contains ( & i) && !file2_considered_lines. contains ( & j)
214
214
{
215
215
file1_considered_lines. push ( i) ;
@@ -242,7 +242,7 @@ impl<'a> FileDiff<'a> {
242
242
243
243
i -= 1
244
244
} else {
245
- if !self . compare_lines ( & self . file1 . line ( i - 1 ) , & self . file2 . line ( j - 1 ) ) {
245
+ if !self . compare_lines ( self . file1 . line ( i - 1 ) , self . file2 . line ( j - 1 ) ) {
246
246
self . add_change ( Change :: Substitute ( ChangeData :: new ( i, j) ) ) ;
247
247
}
248
248
@@ -287,7 +287,7 @@ impl<'a> FileDiff<'a> {
287
287
. hunks
288
288
. hunks ( )
289
289
. iter ( )
290
- . filter ( |hunk| !Change :: is_none ( & hunk. kind ( ) ) && !Change :: is_unchanged ( & hunk. kind ( ) ) )
290
+ . filter ( |hunk| !Change :: is_none ( hunk. kind ( ) ) && !Change :: is_unchanged ( hunk. kind ( ) ) )
291
291
. map ( |hunk| {
292
292
(
293
293
hunk. ln1_start ( ) as i64 ,
0 commit comments