@@ -325,8 +325,8 @@ fn process_change(
325
325
/// `process_changes` assumes that ranges coming from the same *Source File* can and do
326
326
/// occasionally overlap. If it were a desirable property of the blame algorithm as a whole to
327
327
/// never have two different lines from a *Blamed File* mapped to the same line in a *Source File*,
328
- /// this property would need to be enforced at a higher level than `process_changes` if which case
329
- /// the nested loops could potentially be flattened into one.
328
+ /// this property would need to be enforced at a higher level than `process_changes`.
329
+ /// Then the nested loops could potentially be flattened into one.
330
330
fn process_changes (
331
331
hunks_to_blame : Vec < UnblamedHunk > ,
332
332
changes : Vec < Change > ,
@@ -335,13 +335,11 @@ fn process_changes(
335
335
) -> Vec < UnblamedHunk > {
336
336
let mut new_hunks_to_blame = Vec :: new ( ) ;
337
337
338
- for hunk in hunks_to_blame {
339
- let mut hunk = Some ( hunk) ;
340
-
338
+ for mut hunk in hunks_to_blame. into_iter ( ) . map ( Some ) {
341
339
let mut offset_in_destination = Offset :: Added ( 0 ) ;
342
340
343
- let mut changes_iter = changes. iter ( ) ;
344
- let mut change: Option < Change > = changes_iter. next ( ) . cloned ( ) ;
341
+ let mut changes_iter = changes. iter ( ) . cloned ( ) ;
342
+ let mut change = changes_iter. next ( ) ;
345
343
346
344
loop {
347
345
( hunk, change) = process_change (
@@ -353,7 +351,7 @@ fn process_changes(
353
351
change,
354
352
) ;
355
353
356
- change = change. or_else ( || changes_iter. next ( ) . cloned ( ) ) ;
354
+ change = change. or_else ( || changes_iter. next ( ) ) ;
357
355
358
356
if hunk. is_none ( ) {
359
357
break ;
0 commit comments