From ec5f4bdb2ea650d45b1fb772b98d20dd38d8c718 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 5 Dec 2023 17:33:58 +0100 Subject: [PATCH] Allow TryFrom<&str> for ServerName::IpAddress without std --- src/server_name.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/server_name.rs b/src/server_name.rs index 1baa3bf..1b08c1c 100644 --- a/src/server_name.rs +++ b/src/server_name.rs @@ -91,13 +91,10 @@ impl<'a> TryFrom<&'a str> for ServerName<'a> { fn try_from(s: &'a str) -> Result { match DnsName::try_from(s) { Ok(dns) => Ok(Self::DnsName(dns)), - #[cfg(feature = "std")] Err(InvalidDnsNameError) => match IpAddr::try_from(s) { Ok(ip) => Ok(Self::IpAddress(ip)), Err(_) => Err(InvalidDnsNameError), }, - #[cfg(not(feature = "std"))] - Err(InvalidDnsNameError) => Err(InvalidDnsNameError), } } }