Verified Commit 1c4ac07a authored by Maxime Buquet's avatar Maxime Buquet
Browse files

Don't consume Duration in duration_to_string


Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent cac3f78c
......@@ -100,7 +100,7 @@ impl Entry {
}
}
pub fn duration_to_string(d: Duration) -> String {
pub fn duration_to_string(d: &Duration) -> String {
let hours = d.num_minutes() / 60;
let minutes = d.num_minutes() - hours * 60;
format!("{}:{:0>2}", hours, minutes)
......@@ -111,7 +111,7 @@ impl fmt::Display for Entry {
match self.comment {
None => write!(f, "{}: {}:", self.duration, self.task),
Some(ref c) => {
let d = duration_to_string(self.duration);
let d = duration_to_string(&self.duration);
write!(f, "{} {}: {}", d, self.task, c)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment