diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-01-03 23:32:44 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-01-03 23:32:44 +0100 |
commit | 0c76f0c9727a512475e29b5d099b5b7188f72052 (patch) | |
tree | d1c2b59458c62116447fa2d885113afe6a5378da /src/abconfig.rs | |
parent | 5f96d9981a6d041f5c8a464cda10a0dc371060f8 (diff) | |
download | rust-zotapi-0c76f0c9727a512475e29b5d099b5b7188f72052.tar.gz rust-zotapi-0c76f0c9727a512475e29b5d099b5b7188f72052.tar.bz2 rust-zotapi-0c76f0c9727a512475e29b5d099b5b7188f72052.zip |
Move Client out of the api objects.
Also make constructor functions in the zotapi namespace.
Diffstat (limited to 'src/abconfig.rs')
-rw-r--r-- | src/abconfig.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/abconfig.rs b/src/abconfig.rs index 6f9adbe..36b3427 100644 --- a/src/abconfig.rs +++ b/src/abconfig.rs @@ -19,16 +19,14 @@ use crate::{ error::Error, }; -pub struct ABConfigFetcher<'a> { - client: &'a Client, -} +pub struct ABConfig; -impl<'a> ABConfigFetcher<'a> { - pub fn new(client: &'a Client) -> ABConfigFetcher<'a> { - ABConfigFetcher { client } - } +pub fn abconfig() -> ABConfig { + ABConfig {} +} - pub fn fetch(&self) -> Result<String, Error> { - self.client.fetch_stream("abconfig", &()) +impl ABConfig { + pub fn fetch(&self, client: &Client) -> Result<String, Error> { + client.fetch_stream("abconfig", &()) } } |