Skip to content

Commit

Permalink
Changed from vec to intoiter and changelog to version 0.14.0 and rust…
Browse files Browse the repository at this point in the history
… fmt
  • Loading branch information
jakin010 committed Sep 29, 2024
1 parent b1c7a81 commit 48c081d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

**Bugfixes**
- ([#494](https://github.com/ramsayleung/rspotify/pull/494)) Fix endless sequential pagination problem.

## 0.13.4 (unreleased)

**New features**
- ([#496](https://github.com/ramsayleung/rspotify/pull/497)) Add support for searching multiple types


## 0.13.3 (2024.08.24)
**New features**
- ([#490](https://github.com/ramsayleung/rspotify/pull/490)) Add impls for `Clone`, `Debug`, `PartialEq`, `Eq`, `Serialize` and `Hash` for `PlayContextId` and `PlayableId`
Expand Down
7 changes: 5 additions & 2 deletions src/clients/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,18 @@ where
async fn search_multiple(
&self,
q: &str,
_type: Vec<SearchType>,
r#type: impl IntoIterator<Item = SearchType> + Send,
market: Option<Market>,
include_external: Option<IncludeExternal>,
limit: Option<u32>,
offset: Option<u32>,
) -> ClientResult<SearchMultipleResult> {
let limit = limit.map(|s| s.to_string());
let offset = offset.map(|s| s.to_string());
let mut _type = _type.into_iter().map(|x| Into::<&str>::into(x).to_string() + ",").collect::<String>();
let mut _type = r#type
.into_iter()
.map(|x| Into::<&str>::into(x).to_string() + ",")
.collect::<String>();
let params = build_map([
("q", Some(q)),
("type", Some(_type.trim_end_matches(","))),
Expand Down
11 changes: 9 additions & 2 deletions tests/test_with_credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use rspotify::{

use maybe_async::maybe_async;

use rspotify_model::SearchType;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::*;
use rspotify_model::SearchType;

/// Generating a new basic client for the requests.
#[maybe_async]
Expand Down Expand Up @@ -297,7 +297,14 @@ async fn test_search_multiple_types() {
let query = "album:arrival artist:abba";
creds_client()
.await
.search_multiple(query, vec![SearchType::Artist, SearchType::Album], None, None, Some(10), Some(0))
.search_multiple(
query,
vec![SearchType::Artist, SearchType::Album],
None,
None,
Some(10),
Some(0),
)
.await
.unwrap();
}
Expand Down

0 comments on commit 48c081d

Please sign in to comment.