Unified · Split
| @@ -38,7 +38,7 @@ pub mod snapshot; · 37 unmodified lines | |||
| 38 | /// optionally name to find mappings to new names and/or emails. | 38 | /// optionally name to find mappings to new names and/or emails. |
| 39 | /// | 39 | /// |
| 40 | /// The memory layout is efficient, even though lots of small allocations are performed to store strings of emails and names. | 40 | /// 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)] |
| 42 | pub struct Snapshot { | 42 | pub struct Snapshot { |
| 43 | /// Sorted by `old_email` | 43 | /// Sorted by `old_email` |
| 44 | entries_by_old_email: Vec<snapshot::EmailEntry>, | 44 | entries_by_old_email: Vec<snapshot::EmailEntry>, |
| @@ -2,14 +2,14 @@ use bstr::BString; · 1 unmodified line | |||
| 2 | 2 | ||
| 3 | use crate::snapshot::util::{EncodedString, EncodedStringRef}; | 3 | use crate::snapshot::util::{EncodedString, EncodedStringRef}; |
| 4 | 4 | ||
| 5 | #[derive(Clone)] | 5 | #[derive(Clone, Debug, Eq, PartialEq)] |
| 6 | pub(crate) struct NameEntry { | 6 | pub(crate) struct NameEntry { |
| 7 | pub(crate) new_name: Option<BString>, | 7 | pub(crate) new_name: Option<BString>, |
| 8 | pub(crate) new_email: Option<BString>, | 8 | pub(crate) new_email: Option<BString>, |
| 9 | pub(crate) old_name: EncodedString, | 9 | pub(crate) old_name: EncodedString, |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | #[derive(Clone)] | 12 | #[derive(Clone, Debug, Eq, PartialEq)] |
| 13 | pub(crate) struct EmailEntry { | 13 | pub(crate) struct EmailEntry { |
| 14 | pub(crate) new_name: Option<BString>, | 14 | pub(crate) new_name: Option<BString>, |
| 15 | pub(crate) new_email: Option<BString>, | 15 | pub(crate) new_email: Option<BString>, |
| @@ -2,8 +2,7 @@ use std::{cmp::Ordering, ops::Deref}; · 1 unmodified line | |||
| 2 | 2 | ||
| 3 | use bstr::{BStr, BString, ByteSlice}; | 3 | use bstr::{BStr, BString, ByteSlice}; |
| 4 | 4 | ||
| 5 | #[cfg_attr(test, derive(Debug))] | 5 | #[derive(Clone, Debug, Eq, PartialEq)] |
| 6 | #[derive(Clone)] | ||
| 7 | pub enum EncodedString { | 6 | pub enum EncodedString { |
| 8 | Utf8(String), | 7 | Utf8(String), |
| 9 | Unknown(BString), | 8 | Unknown(BString), |