Implement Display for Name
authorMatt Corallo <git@bluematt.me>
Sun, 11 Feb 2024 23:01:18 +0000 (23:01 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 11 Feb 2024 23:01:18 +0000 (23:01 +0000)
src/rr.rs

index c5855559c9efa1479e44d2568a2b152092f6c885..981d2b8126bedd2603ae707dcd86e7267376f1a0 100644 (file)
--- a/src/rr.rs
+++ b/src/rr.rs
@@ -9,6 +9,7 @@ use alloc::borrow::ToOwned;
 use alloc::format;
 
 use core::cmp::{self, Ordering};
+use core::fmt;
 use core::fmt::Write;
 
 use crate::ser::*;
@@ -27,6 +28,11 @@ impl core::ops::Deref for Name {
        type Target = str;
        fn deref(&self) -> &str { &self.0 }
 }
+impl fmt::Display for Name {
+       fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+               self.0.fmt(f)
+       }
+}
 impl TryFrom<String> for Name {
        type Error = ();
        fn try_from(s: String) -> Result<Name, ()> {