diff --git a/nym-client/src/client/mod.rs b/nym-client/src/client/mod.rs index ffcd00f141..d5be2af964 100644 --- a/nym-client/src/client/mod.rs +++ b/nym-client/src/client/mod.rs @@ -39,15 +39,9 @@ pub enum SocketType { None, } -impl From for SocketType { - fn from(v: String) -> Self { - Self::from(v.as_ref()) - } -} - -impl From<&str> for SocketType { - fn from(v: &str) -> Self { - let mut upper = v.to_string(); +impl SocketType { + pub fn from_string>(val: S) -> Self { + let mut upper = val.into(); upper.make_ascii_uppercase(); match upper.as_ref() { "TCP" => SocketType::TCP,