Skip to content

Commit

Permalink
reuse try_from_str in TryFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
DSharifi committed Jan 24, 2025
1 parent ce68828 commit bc1c252
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/server_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ impl<'a> TryFrom<&'a str> for DnsName<'a> {
type Error = InvalidDnsNameError;

fn try_from(value: &'a str) -> Result<Self, Self::Error> {
validate(value.as_bytes())?;
Ok(Self(DnsNameInner::Borrowed(value)))
DnsName::try_from_str(value)
}
}

Expand Down

0 comments on commit bc1c252

Please sign in to comment.