We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d19568 commit cac5af2Copy full SHA for cac5af2
asyncgit/src/sync/diff.rs
@@ -227,13 +227,11 @@ impl ConsumeHunk for FileDiff {
227
) -> std::io::Result<()> {
228
let lines = hunk
229
.lines()
230
- .enumerate()
231
- .map(|(index, line)| DiffLine {
+ .zip(0..)
+ .map(|(line, index)| DiffLine {
232
position: DiffLinePosition {
233
- old_lineno: Some(
234
- before_hunk_start + index as u32,
235
- ),
236
- new_lineno: Some(after_hunk_start + index as u32),
+ old_lineno: Some(before_hunk_start + index),
+ new_lineno: Some(after_hunk_start + index),
237
},
238
content: String::from_utf8_lossy(line)
239
.trim_matches(is_newline)
0 commit comments