Skip to content

Commit 98007e6

Browse files
committed
fix: add standard traits (Debug, Eq) to Snapshot (#1424)
1 parent 8d89b86 commit 98007e6

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

gix-mailmap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub mod snapshot;
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
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use bstr::BString;
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
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use std::{cmp::Ordering, ops::Deref};
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),

0 commit comments

Comments
 (0)