From 22208dc490d5485cafd18c31ac5a08d9ff46c2d4 Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Mon, 18 Sep 2023 18:51:00 +0200 Subject: impl From for &str --- src/client.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client.rs b/src/client.rs index 57734de..87fbc79 100644 --- a/src/client.rs +++ b/src/client.rs @@ -15,6 +15,15 @@ pub enum Endpoint { Sandbox, } +impl From for &str { + fn from(endpoint: Endpoint) -> &'static str { + match endpoint { + Endpoint::Production => "https://api.domrobot.com/xmlrpc/", + Endpoint::Sandbox => "https://api.ote.domrobot.com/xmlrpc/", + } + } +} + impl From for String { fn from(endpoint: Endpoint) -> String { match endpoint { -- cgit v1.2.3