aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs
index 7839c2d..6dd3e91 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,15 +30,17 @@ fn main() {
// std::str::from_utf8(line.content()).unwrap(),
// );
- let l = std::str::from_utf8(line.content()).unwrap();
-
- if l.contains("TODO") {
- println!(
- "{}:{}:{}",
- delta.new_file().path().unwrap().display(),
- line.new_lineno().unwrap(),
- l,
- );
+ if let Some(line_number) = line.new_lineno() {
+ let l = std::str::from_utf8(line.content()).unwrap();
+
+ if l.contains("TODO") {
+ println!(
+ "{}:{}:{}",
+ delta.new_file().path().unwrap().display(),
+ line_number,
+ l,
+ );
+ }
}
true