@@ -325,8 +325,8 @@ fn process_change(
325325/// `process_changes` assumes that ranges coming from the same *Source File* can and do
326326/// occasionally overlap. If it were a desirable property of the blame algorithm as a whole to
327327/// 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.
330330fn process_changes (
331331 hunks_to_blame : Vec < UnblamedHunk > ,
332332 changes : Vec < Change > ,
@@ -335,13 +335,11 @@ fn process_changes(
335335) -> Vec < UnblamedHunk > {
336336 let mut new_hunks_to_blame = Vec :: new ( ) ;
337337
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 ) {
341339 let mut offset_in_destination = Offset :: Added ( 0 ) ;
342340
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 ( ) ;
345343
346344 loop {
347345 ( hunk, change) = process_change (
@@ -353,7 +351,7 @@ fn process_changes(
353351 change,
354352 ) ;
355353
356- change = change. or_else ( || changes_iter. next ( ) . cloned ( ) ) ;
354+ change = change. or_else ( || changes_iter. next ( ) ) ;
357355
358356 if hunk. is_none ( ) {
359357 break ;
0 commit comments