diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-10-24 21:52:30 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-10-24 21:52:30 +0200 |
commit | a607f4bcab2e846cb2b91761be808eb516d03d8f (patch) | |
tree | e8586e6a02ffdf09d7e38fbd2bcc789444c70d20 /src/call | |
parent | 0acc44b468a6c244620efee7470fc24d6971e085 (diff) |
get rid of some of the static lifetimes
Diffstat (limited to 'src/call')
-rw-r--r-- | src/call/account.rs | 16 | ||||
-rw-r--r-- | src/call/mod.rs | 4 | ||||
-rw-r--r-- | src/call/nameserver.rs | 16 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/call/account.rs b/src/call/account.rs index 2cd89d5..6f60c8d 100644 --- a/src/call/account.rs +++ b/src/call/account.rs @@ -23,12 +23,12 @@ impl From<Login<'_>> for xmlrpc::Value { } impl Call for Login<'_> { - fn method_name(&self) -> &'static str { - "account.login" + fn method_name(&self) -> String { + String::from("account.login") } - fn expected(&self) -> &'static [i32] { - &[1000] + fn expected(&self) -> Vec<i32> { + vec![1000] } } @@ -44,10 +44,10 @@ impl From<Logout> for xmlrpc::Value { } impl Call for Logout { - fn method_name(&self) -> &'static str { - "account.logout" + fn method_name(&self) -> String { + String::from("account.logout") } - fn expected(&self) -> &'static [i32] { - &[1500] + fn expected(&self) -> Vec<i32> { + vec![1500] } } diff --git a/src/call/mod.rs b/src/call/mod.rs index 6b44a16..f8fe0a2 100644 --- a/src/call/mod.rs +++ b/src/call/mod.rs @@ -1,7 +1,7 @@ // A call to the API. pub trait Call: Clone + std::fmt::Debug + Into<xmlrpc::Value> { - fn method_name(&self) -> &'static str; - fn expected(&self) -> &'static [i32]; + fn method_name(&self) -> String; + fn expected(&self) -> Vec<i32>; } pub mod account; diff --git a/src/call/nameserver.rs b/src/call/nameserver.rs index 884edab..c490a31 100644 --- a/src/call/nameserver.rs +++ b/src/call/nameserver.rs @@ -54,12 +54,12 @@ impl From<RecordInfo> for xmlrpc::Value { } impl Call for RecordInfo { - fn method_name(&self) -> &'static str { - "nameserver.info" + fn method_name(&self) -> String { + String::from("nameserver.info") } - fn expected(&self) -> &'static [i32] { - &[1000] + fn expected(&self) -> Vec<i32> { + vec![1000] } } @@ -142,11 +142,11 @@ impl From<RecordUpdate> for xmlrpc::Value { } impl Call for RecordUpdate { - fn method_name(&self) -> &'static str { - "nameserver.updateRecord" + fn method_name(&self) -> String { + String::from("nameserver.updateRecord") } - fn expected(&self) -> &'static [i32] { - &[1000] + fn expected(&self) -> Vec<i32> { + vec![1000] } } |