diff --git a/src/git.rs b/src/git.rs
@@ -102,12 +102,12 @@ impl Git {
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 @@ impl From<Signature<'_>> for CommitUser {
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(),
}
}
}
diff --git a/src/methods/filters.rs b/src/methods/filters.rs
@@ -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()))
-}
\ No newline at end of file
+}
diff --git a/src/methods/mod.rs b/src/methods/mod.rs
@@ -1,3 +1,3 @@
+pub mod filters;
pub mod index;
pub mod repo;
-pub mod filters;
\ No newline at end of file