Skip to content

Commit ae3660a

Browse files
authored
Merge pull request #890 from kim/eq-signature
PartialEq, Eq for Signature
2 parents 1e9c9ce + 4dd0bf6 commit ae3660a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: src/signature.rs

+10
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ impl<'a> fmt::Display for Signature<'a> {
158158
}
159159
}
160160

161+
impl PartialEq for Signature<'_> {
162+
fn eq(&self, other: &Self) -> bool {
163+
self.when() == other.when()
164+
&& self.email_bytes() == other.email_bytes()
165+
&& self.name_bytes() == other.name_bytes()
166+
}
167+
}
168+
169+
impl Eq for Signature<'_> {}
170+
161171
#[cfg(test)]
162172
mod tests {
163173
use crate::{Signature, Time};

0 commit comments

Comments
 (0)