Don't error on peel_to_tag failing
Diff
src/git.rs | 15 +++++++++------
src/methods/filters.rs | 2 +-
src/methods/mod.rs | 2 +-
3 files changed, 9 insertions(+), 10 deletions(-)
@@ -102,12 +102,12 @@
commit: commit.into(),
});
} else if ref_.is_tag() {
let tag = ref_.peel_to_tag().unwrap();
built_refs.tag.push(Tag {
name: ref_.shorthand().unwrap().to_string(),
tagger: tag.tagger().map(Into::into),
});
if let Ok(tag) = ref_.peel_to_tag() {
built_refs.tag.push(Tag {
name: ref_.shorthand().unwrap().to_string(),
tagger: tag.tagger().map(Into::into),
});
}
}
}
@@ -284,8 +284,7 @@
name: v.name().unwrap().to_string(),
email: v.email().unwrap().to_string(),
email_md5: format!("{:x}", md5::compute(v.email_bytes())),
time: OffsetDateTime::from_unix_timestamp(v.when().seconds())
.unwrap(),
time: OffsetDateTime::from_unix_timestamp(v.when().seconds()).unwrap(),
}
}
}
@@ -1,3 +1,3 @@
pub fn timeago(s: time::OffsetDateTime) -> Result<String, askama::Error> {
Ok(timeago::Formatter::new().convert((time::OffsetDateTime::now_utc() - s).unsigned_abs()))
}
}
@@ -1,3 +1,3 @@
pub mod filters;
pub mod index;
pub mod repo;
pub mod filters;