Skip to content

Commit 3f94c51

Browse files
committed
thanks clippy
1 parent 397b4ae commit 3f94c51

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/info/repo.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub struct Repo<'a> {
2424
time_of_first_commit: git::actor::Time,
2525
}
2626

27-
#[derive(Hash)]
2827
pub struct Sig {
2928
name: git::bstr::BString,
3029
email: git::bstr::BString,
@@ -43,6 +42,15 @@ impl From<git::actor::Signature> for Sig {
4342
}
4443
}
4544

45+
impl std::hash::Hash for Sig {
46+
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
47+
self.email_lowercase
48+
.as_ref()
49+
.map(|email_lc| email_lc.hash(state))
50+
.unwrap_or_else(|| self.email.hash(state))
51+
}
52+
}
53+
4654
impl Eq for Sig {}
4755

4856
impl PartialEq<Self> for Sig {

0 commit comments

Comments
 (0)