aboutsummaryrefslogtreecommitdiff
path: root/src/mail/unique_ident.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-12 15:59:13 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-12 15:59:13 +0200
commit9b7d999fd52dc3410b97ca831238b084650be1b3 (patch)
tree34b78838be9e13a41f04c17b57ac3a1f5311b3a9 /src/mail/unique_ident.rs
parentfc2e25ce76c20a4d2e8316317c7303ae8d78b031 (diff)
downloadaerogramme-9b7d999fd52dc3410b97ca831238b084650be1b3.tar.gz
aerogramme-9b7d999fd52dc3410b97ca831238b084650be1b3.zip
Implement STATUS
Diffstat (limited to 'src/mail/unique_ident.rs')
-rw-r--r--src/mail/unique_ident.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mail/unique_ident.rs b/src/mail/unique_ident.rs
index 19de6fc..267f66e 100644
--- a/src/mail/unique_ident.rs
+++ b/src/mail/unique_ident.rs
@@ -16,7 +16,7 @@ use crate::time::now_msec;
/// required by Aerogramme.
/// Their main property is to be unique without having to rely
/// on synchronization between IMAP processes.
-#[derive(Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash, Debug)]
+#[derive(Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash)]
pub struct UniqueIdent(pub [u8; 24]);
struct IdentGenerator {
@@ -78,6 +78,12 @@ impl std::fmt::Display for UniqueIdent {
}
}
+impl std::fmt::Debug for UniqueIdent {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{}", hex::encode(self.0))
+ }
+}
+
impl FromStr for UniqueIdent {
type Err = &'static str;