Skip to content

Commit a6608cb

Browse files
committed
fix: clippy errors
1 parent c7c87a2 commit a6608cb

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

packages/rest-tracker-api-client/src/v1/client.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ const API_PATH: &str = "api/v1/";
1616
const DEFAULT_REQUEST_TIMEOUT_IN_SECS: u64 = 5;
1717

1818
/// API Client
19+
#[allow(clippy::struct_field_names)]
1920
pub struct Client {
2021
connection_info: ConnectionInfo,
2122
base_path: String,
22-
client: reqwest::Client,
23+
http_client: reqwest::Client,
2324
}
2425

2526
impl Client {
@@ -34,7 +35,7 @@ impl Client {
3435
Ok(Self {
3536
connection_info,
3637
base_path: API_PATH.to_string(),
37-
client,
38+
http_client: client,
3839
})
3940
}
4041

@@ -92,7 +93,7 @@ impl Client {
9293
///
9394
/// Will panic if the request can't be sent
9495
pub async fn post_empty(&self, path: &str, headers: Option<HeaderMap>) -> Response {
95-
let builder = self.client.post(self.base_url(path).clone());
96+
let builder = self.http_client.post(self.base_url(path).clone());
9697

9798
let builder = match headers {
9899
Some(headers) => builder.headers(headers),
@@ -111,7 +112,7 @@ impl Client {
111112
///
112113
/// Will panic if the request can't be sent
113114
pub async fn post_form<T: Serialize + ?Sized>(&self, path: &str, form: &T, headers: Option<HeaderMap>) -> Response {
114-
let builder = self.client.post(self.base_url(path).clone()).json(&form);
115+
let builder = self.http_client.post(self.base_url(path).clone()).json(&form);
115116

116117
let builder = match headers {
117118
Some(headers) => builder.headers(headers),
@@ -130,7 +131,7 @@ impl Client {
130131
///
131132
/// Will panic if the request can't be sent
132133
async fn delete(&self, path: &str, headers: Option<HeaderMap>) -> Response {
133-
let builder = self.client.delete(self.base_url(path).clone());
134+
let builder = self.http_client.delete(self.base_url(path).clone());
134135

135136
let builder = match headers {
136137
Some(headers) => builder.headers(headers),

packages/tracker-client/src/http/client/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ pub enum Error {
2323
}
2424

2525
/// HTTP Tracker Client
26+
#[allow(clippy::struct_field_names)]
2627
pub struct Client {
27-
client: reqwest::Client,
28+
http_client: reqwest::Client,
2829
base_url: Url,
2930
key: Option<Key>,
3031
}
@@ -49,7 +50,7 @@ impl Client {
4950

5051
Ok(Self {
5152
base_url,
52-
client,
53+
http_client: client,
5354
key: None,
5455
})
5556
}
@@ -68,7 +69,7 @@ impl Client {
6869

6970
Ok(Self {
7071
base_url,
71-
client,
72+
http_client: client,
7273
key: None,
7374
})
7475
}
@@ -84,7 +85,7 @@ impl Client {
8485

8586
Ok(Self {
8687
base_url,
87-
client,
88+
http_client: client,
8889
key: Some(key),
8990
})
9091
}
@@ -159,7 +160,7 @@ impl Client {
159160
///
160161
/// This method fails if there was an error while sending request.
161162
pub async fn get(&self, path: &str) -> Result<Response, Error> {
162-
self.client
163+
self.http_client
163164
.get(self.build_url(path))
164165
.send()
165166
.await
@@ -170,7 +171,7 @@ impl Client {
170171
///
171172
/// This method fails if there was an error while sending request.
172173
pub async fn get_with_header(&self, path: &str, key: &str, value: &str) -> Result<Response, Error> {
173-
self.client
174+
self.http_client
174175
.get(self.build_url(path))
175176
.header(key, value)
176177
.send()

src/bootstrap/jobs/health_check_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! The [`health_check_api::start_job`](crate::bootstrap::jobs::health_check_api::start_job)
44
//! function starts the Health Check REST API.
55
//!
6-
//! The [`health_check_api::start_job`](crate::bootstrap::jobs::health_check_api::start_job)
6+
//! The [`health_check_api::start_job`](crate::bootstrap::jobs::health_check_api::start_job)
77
//! function spawns a new asynchronous task, that tasks is the "**launcher**".
88
//! The "**launcher**" starts the actual server and sends a message back
99
//! to the main application.

src/bootstrap/jobs/tracker_apis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! > versions. API consumers can choose which version to use. The API version is
88
//! > part of the URL, for example: `http://localhost:1212/api/v1/stats`.
99
//!
10-
//! The [`tracker_apis::start_job`](crate::bootstrap::jobs::tracker_apis::start_job)
10+
//! The [`tracker_apis::start_job`](crate::bootstrap::jobs::tracker_apis::start_job)
1111
//! function spawns a new asynchronous task, that tasks is the "**launcher**".
1212
//! The "**launcher**" starts the actual server and sends a message back
1313
//! to the main application. The main application waits until receives

0 commit comments

Comments
 (0)