mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-27 06:23:18 +00:00
files: use imported DiffHunk type in DiffLineIterator
This commit is contained in:
parent
a62c8776e8
commit
54f5c01eae
1 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ impl<'a> Iterator for DiffLineIterator<'a> {
|
||||||
let hunk = &self.diff_hunks[self.current_pos];
|
let hunk = &self.diff_hunks[self.current_pos];
|
||||||
self.current_pos += 1;
|
self.current_pos += 1;
|
||||||
match hunk {
|
match hunk {
|
||||||
diff::DiffHunk::Matching(text) => {
|
DiffHunk::Matching(text) => {
|
||||||
let lines = text.split_inclusive(|b| *b == b'\n');
|
let lines = text.split_inclusive(|b| *b == b'\n');
|
||||||
for line in lines {
|
for line in lines {
|
||||||
self.current_line.has_left_content = true;
|
self.current_line.has_left_content = true;
|
||||||
|
@ -98,7 +98,7 @@ impl<'a> Iterator for DiffLineIterator<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff::DiffHunk::Different(contents) => {
|
DiffHunk::Different(contents) => {
|
||||||
let left_lines = contents[0].split_inclusive(|b| *b == b'\n');
|
let left_lines = contents[0].split_inclusive(|b| *b == b'\n');
|
||||||
for left_line in left_lines {
|
for left_line in left_lines {
|
||||||
self.current_line.has_left_content = true;
|
self.current_line.has_left_content = true;
|
||||||
|
|
Loading…
Reference in a new issue