diff --git a/src/name.rs b/src/name.rs index 24cb69f0..23edee87 100644 --- a/src/name.rs +++ b/src/name.rs @@ -42,6 +42,9 @@ pub struct DNSName(String); impl DNSName { /// Returns a `DNSNameRef` that refers to this `DNSName`. pub fn as_ref(&self) -> DNSNameRef { DNSNameRef(self.0.as_bytes()) } + + /// Returns this `DNSName` as `&str` + pub fn as_str(&self) -> &str { self.0.as_ref() } } #[cfg(feature = "std")]