diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-10-24 22:27:53 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-10-24 22:28:13 +0200 |
commit | 1344b0613606400e10d5d0780ba969d61d72ffd5 (patch) | |
tree | 9eb0e6c0983efdbb3e35b3f30837ee6a30facd3a | |
parent | c29b14c101473613b3b8c94553d95530fe4ceb89 (diff) |
`String`ify Endpoint
-rw-r--r-- | src/client.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.rs b/src/client.rs index d736b99..857483b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -14,18 +14,18 @@ pub enum Endpoint { Sandbox, } -impl From<Endpoint> for &str { - fn from(endpoint: Endpoint) -> &'static str { +impl From<Endpoint> for String { + fn from(endpoint: Endpoint) -> String { match endpoint { - Endpoint::Production => "https://api.domrobot.com/xmlrpc/", - Endpoint::Sandbox => "https://api.ote.domrobot.com/xmlrpc/", + Endpoint::Production => String::from("https://api.domrobot.com/xmlrpc/"), + Endpoint::Sandbox => String::from("https://api.ote.domrobot.com/xmlrpc/"), } } } impl From<Endpoint> for Url { fn from(endpoint: Endpoint) -> Self { - Url::parse(endpoint.into()).unwrap() + String::from(endpoint).parse().unwrap() } } |