From e4f3ec4aa8fb435b0bdeff23618a662182283a6e Mon Sep 17 00:00:00 2001 From: Damian Poddebniak Date: Tue, 10 Oct 2023 15:03:33 +0200 Subject: [PATCH] feat: Implement `Display` for `Text` --- imap-types/src/core.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imap-types/src/core.rs b/imap-types/src/core.rs index 7e53c1ff..f9f4e523 100644 --- a/imap-types/src/core.rs +++ b/imap-types/src/core.rs @@ -1130,6 +1130,12 @@ impl<'a> Debug for Text<'a> { } } +impl<'a> Display for Text<'a> { + fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { + write!(f, "{}", self.0.as_ref()) + } +} + impl<'a> Text<'a> { pub fn validate(value: impl AsRef<[u8]>) -> Result<(), ValidationError> { let value = value.as_ref();