Skip to content

Commit 0bf30ea

Browse files
committed
thanks clipp
1 parent a161e33 commit 0bf30ea

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

git-attributes/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ pub mod parse {
4040
}
4141
let mut lines = self.cursor.lines();
4242
let res = None;
43-
while let Some(line) = lines.next() {
43+
for line in lines.by_ref() {
4444
if line.starts_with(b"#") {
4545
continue;
4646
}
4747
todo!("handle escapes and trim trailing non-escaped whitespace")
4848
}
49-
if let Some(next_line) = lines.next() {
50-
self.cursor = next_line.as_bstr();
51-
}
49+
self.cursor = lines.next().unwrap_or(&[]).as_bstr();
5250
res
5351
}
5452
}

0 commit comments

Comments
 (0)