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(
&mut self,
limit: Option<u16>,
tags: Option<Vec<String>>,
tags: Option<String>,
page: Option<u32>,
) -> Result<Response> {
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 tags.len() > 0 {
query_params.push(format!("tags={}", tags.join(",")));
if !tags.is_empty() {
query_params.push(format!("tags={tags}"));
}
}