diff options
Diffstat (limited to 'src/abconfig.rs')
-rw-r--r-- | src/abconfig.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/abconfig.rs b/src/abconfig.rs index c8af6c5..723747c 100644 --- a/src/abconfig.rs +++ b/src/abconfig.rs @@ -16,8 +16,6 @@ use crate::{client::Client, error::Error}; use serde::Deserialize; -use std::collections::HashMap; -use std::iter::FromIterator; /// A struct for storing a key value pair with a category in /// relation to a contact. Typically used to store permissions @@ -56,9 +54,11 @@ pub struct ABConfigRequest { impl ABConfigRequest { pub fn fetch(&self, client: &Client) -> Result<Vec<ABConfig>, Error> { - let data: HashMap<&str, String> = HashMap::from_iter(vec![("abook_id", self.abook_id.to_string())]); - let body = client.fetch_stream("abconfig", &data)?; - Ok(serde_json::from_str(&body)?) + let mut res = client.get("abconfig") + .query(&[("abook_id", self.abook_id.to_string())]) + .send()?; + + Ok(serde_json::from_str(&res.text()?)?) } } |