Skip to content

Commit 98bc939

Browse files
committed
Switch to standard library naming scheme
1 parent 863c4a6 commit 98bc939

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/client.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,27 @@ impl Client<'_> {
4343
}
4444

4545
/// Calls [`GET /best_podcasts`](https://www.listennotes.com/api/docs/#get-api-v2-best_podcasts) with supplied parameters.
46-
pub async fn best_podcasts(&self, parameters: &Value) -> Result<Value> {
46+
pub async fn fetch_best_podcasts(&self, parameters: &Value) -> Result<Value> {
4747
self.get("best_podcasts", parameters).await
4848
}
4949

5050
/// Calls [`GET /podcasts/{id}`](https://www.listennotes.com/api/docs/#get-api-v2-podcasts-id) with supplied parameters.
51-
pub async fn podcast(&self, id: &str, parameters: &Value) -> Result<Value> {
51+
pub async fn fetch_podcast_by_id(&self, id: &str, parameters: &Value) -> Result<Value> {
5252
self.get(&format!("podcasts/{}", id), parameters).await
5353
}
5454

5555
/// Calls [`POST /podcasts`](https://www.listennotes.com/api/docs/#post-api-v2-podcasts) with supplied parameters.
56-
pub async fn podcasts(&self, parameters: &Value) -> Result<Value> {
56+
pub async fn batch_fetch_podcasts(&self, parameters: &Value) -> Result<Value> {
5757
self.post("podcasts", parameters).await
5858
}
5959

6060
/// Calls [`GET /episodes/{id}`](https://www.listennotes.com/api/docs/#get-api-v2-episodes-id) with supplied parameters.
61-
pub async fn episode(&self, id: &str, parameters: &Value) -> Result<Value> {
61+
pub async fn fetch_episode_by_id(&self, id: &str, parameters: &Value) -> Result<Value> {
6262
self.get(&format!("episodes/{}", id), parameters).await
6363
}
6464

6565
/// Calls [`POST /episodes`](https://www.listennotes.com/api/docs/#post-api-v2-episodes) with supplied parameters.
66-
pub async fn episodes(&self, parameters: &Value) -> Result<Value> {
66+
pub async fn batch_fetch_episodes(&self, parameters: &Value) -> Result<Value> {
6767
self.post("episodes", parameters).await
6868
}
6969

tests/client_tests.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ mod mock {
3434
}
3535

3636
#[test]
37-
fn best_podcasts() {
38-
let response = b!(client().best_podcasts(&json!({
37+
fn fetch_best_podcasts() {
38+
let response = b!(client().fetch_best_podcasts(&json!({
3939
"genre_id": 23,
4040
})))
4141
.unwrap();
@@ -44,15 +44,15 @@ mod mock {
4444
}
4545

4646
#[test]
47-
fn podcast() {
48-
let response = b!(client().podcast("dummy_id", &json!({}))).unwrap();
47+
fn fetch_podcast_by_id() {
48+
let response = b!(client().fetch_podcast_by_id("dummy_id", &json!({}))).unwrap();
4949
assert!(response.is_object());
5050
assert!(response["episodes"].as_array().unwrap().len() > 0);
5151
}
5252

5353
#[test]
54-
fn podcasts() {
55-
let response = b!(client().podcasts(&json!({
54+
fn batch_fetch_podcasts() {
55+
let response = b!(client().batch_fetch_podcasts(&json!({
5656
"ids": "996,777,888,1000"
5757
})))
5858
.unwrap();
@@ -61,8 +61,8 @@ mod mock {
6161
}
6262

6363
#[test]
64-
fn episode() {
65-
let response = b!(client().episode("dummy_id", &json!({}))).unwrap();
64+
fn fetch_episode_by_id() {
65+
let response = b!(client().fetch_episode_by_id("dummy_id", &json!({}))).unwrap();
6666
assert!(response.is_object());
6767
assert!(
6868
response["podcast"].as_object().unwrap()["rss"]
@@ -74,8 +74,8 @@ mod mock {
7474
}
7575

7676
#[test]
77-
fn episodes() {
78-
let response = b!(client().episodes(&json!({
77+
fn batch_fetch_episodes() {
78+
let response = b!(client().batch_fetch_episodes(&json!({
7979
"ids": "996,777,888,1000"
8080
})))
8181
.unwrap();

0 commit comments

Comments
 (0)