Skip to content

Commit

Permalink
fix: add standard traits (Debug, Eq) to Snapshot (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jun 26, 2024
1 parent 8d89b86 commit 98007e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gix-mailmap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub mod snapshot;
/// optionally name to find mappings to new names and/or emails.
///
/// The memory layout is efficient, even though lots of small allocations are performed to store strings of emails and names.
#[derive(Default, Clone)]
#[derive(Default, Clone, Debug, Eq, PartialEq)]
pub struct Snapshot {
/// Sorted by `old_email`
entries_by_old_email: Vec<snapshot::EmailEntry>,
Expand Down
4 changes: 2 additions & 2 deletions gix-mailmap/src/snapshot/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use bstr::BString;

use crate::snapshot::util::{EncodedString, EncodedStringRef};

#[derive(Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct NameEntry {
pub(crate) new_name: Option<BString>,
pub(crate) new_email: Option<BString>,
pub(crate) old_name: EncodedString,
}

#[derive(Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct EmailEntry {
pub(crate) new_name: Option<BString>,
pub(crate) new_email: Option<BString>,
Expand Down
3 changes: 1 addition & 2 deletions gix-mailmap/src/snapshot/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use std::{cmp::Ordering, ops::Deref};

use bstr::{BStr, BString, ByteSlice};

#[cfg_attr(test, derive(Debug))]
#[derive(Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum EncodedString {
Utf8(String),
Unknown(BString),
Expand Down

0 comments on commit 98007e6

Please sign in to comment.