Skip to content

Commit

Permalink
closing #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Criomby committed Sep 25, 2023
1 parent 66a9d47 commit c60eeb6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/simil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ pub fn similarities(
);
let mut fl1 = 0;
let mut fl2;
let mut last_found = 0;
let mut fl1_last_found = 0;
let mut fl2_last_found = 0;
let mut n_found = 0;
'outer1: for line in file1.lines() {
fl1 += 1;
Expand Down Expand Up @@ -92,7 +93,7 @@ pub fn similarities(
}
// end ignore starts with
if text1 == text2 {
if fl1 == last_found + 1 {
if fl1 == fl1_last_found + 1 || fl2 == fl2_last_found + 1 {
println!("... {}", text1);
} else {
println!(
Expand All @@ -107,7 +108,8 @@ pub fn similarities(
println!(">>> {}", text1);
}
n_found += 1;
last_found = fl1;
fl1_last_found = fl1;
fl2_last_found = fl2;
}
}
}
Expand Down

0 comments on commit c60eeb6

Please sign in to comment.