History

fix: add standard traits (Debug, Eq) to `Snapshot` (#1424)

Sebastian Thiel committed 2 years ago

Commit 98007e61 parent 8d89b863 files · +4 −5Browse files

Unified · Split

3 files
  1. gix-mailmap/src/lib.rs +1 −1
  2. gix-mailmap/src/snapshot/entry.rs +2 −2
  3. gix-mailmap/src/snapshot/util.rs +1 −2
gix-mailmap/src/lib.rs+1−1
@@ -38,7 +38,7 @@ pub mod snapshot; · 37 unmodified lines
3838 /// optionally name to find mappings to new names and/or emails.
3939 ///
4040 /// The memory layout is efficient, even though lots of small allocations are performed to store strings of emails and names.
41−#[derive(Default, Clone)]
41+#[derive(Default, Clone, Debug, Eq, PartialEq)]
4242 pub struct Snapshot {
4343 /// Sorted by `old_email`
4444 entries_by_old_email: Vec<snapshot::EmailEntry>,
gix-mailmap/src/snapshot/entry.rs+2−2
@@ -2,14 +2,14 @@ use bstr::BString; · 1 unmodified line
22
33 use crate::snapshot::util::{EncodedString, EncodedStringRef};
44
5−#[derive(Clone)]
5+#[derive(Clone, Debug, Eq, PartialEq)]
66 pub(crate) struct NameEntry {
77 pub(crate) new_name: Option<BString>,
88 pub(crate) new_email: Option<BString>,
99 pub(crate) old_name: EncodedString,
1010 }
1111
12−#[derive(Clone)]
12+#[derive(Clone, Debug, Eq, PartialEq)]
1313 pub(crate) struct EmailEntry {
1414 pub(crate) new_name: Option<BString>,
1515 pub(crate) new_email: Option<BString>,
gix-mailmap/src/snapshot/util.rs+1−2
@@ -2,8 +2,7 @@ use std::{cmp::Ordering, ops::Deref}; · 1 unmodified line
22
33 use bstr::{BStr, BString, ByteSlice};
44
5−#[cfg_attr(test, derive(Debug))]
6−#[derive(Clone)]
5+#[derive(Clone, Debug, Eq, PartialEq)]
76 pub enum EncodedString {
87 Utf8(String),
98 Unknown(BString),