Use String instead of Vec<String> for post query
This commit is contained in:
parent
405ff47221
commit
feb247b976
1 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ impl<'a> Client<'a> {
|
||||||
async fn list_posts_raw(
|
async fn list_posts_raw(
|
||||||
&mut self,
|
&mut self,
|
||||||
limit: Option<u16>,
|
limit: Option<u16>,
|
||||||
tags: Option<Vec<String>>,
|
tags: Option<String>,
|
||||||
page: Option<u32>,
|
page: Option<u32>,
|
||||||
) -> Result<Response> {
|
) -> Result<Response> {
|
||||||
let mut url = url::Url::parse(format!("{}/posts.json", self.host).as_str())?;
|
let mut url = url::Url::parse(format!("{}/posts.json", self.host).as_str())?;
|
||||||
|
@ -56,8 +56,8 @@ impl<'a> Client<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(tags) = tags {
|
if let Some(tags) = tags {
|
||||||
if tags.len() > 0 {
|
if !tags.is_empty() {
|
||||||
query_params.push(format!("tags={}", tags.join(",")));
|
query_params.push(format!("tags={tags}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue