aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 46e0fc8..1b9689a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,9 +1,11 @@
#![warn(rust_2018_idioms)]
+use std::io::Write;
+
use git2::Repository;
-pub fn write_since() {
+pub fn write_since<W: Write>(write_to: &mut W) {
let repo = Repository::open(".").unwrap();
// let head = repo.head().unwrap().target().unwrap();
@@ -32,12 +34,13 @@ pub fn write_since() {
let l = std::str::from_utf8(line.content()).unwrap();
if l.contains("TODO") {
- print!(
+ write!(
+ write_to,
"{}:{}:{}",
delta.new_file().path().unwrap().display(),
line_number,
l,
- );
+ ).unwrap();
}
}