Use String instead of Vec<String> for post query

This commit is contained in:
Leon Grünewald 2024-01-01 21:50:57 +01:00
parent 405ff47221
commit feb247b976

View file

@ -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}"));
} }
} }