Skip to content

Commit 17aecf9

Browse files
committed
fix: clippy warnings
1 parent 649565f commit 17aecf9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/config/v2/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Network {
4646
}
4747

4848
fn default_ip() -> IpAddr {
49-
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0))
49+
IpAddr::V4(Ipv4Addr::UNSPECIFIED)
5050
}
5151

5252
fn default_port() -> u16 {

src/tracker/api.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const TOTAL_REQUEST_TIMEOUT_IN_SECS: u64 = 5;
2323
pub struct Client {
2424
pub connection_info: ConnectionInfo,
2525
api_base_url: Url,
26-
client: reqwest::Client,
26+
http: reqwest::Client,
2727
token_param: [(String, String); 1],
2828
}
2929

@@ -45,7 +45,7 @@ impl Client {
4545
Ok(Self {
4646
connection_info,
4747
api_base_url,
48-
client,
48+
http: client,
4949
token_param,
5050
})
5151
}
@@ -58,7 +58,7 @@ impl Client {
5858
pub async fn whitelist_torrent(&self, info_hash: &str) -> Result<Response, Error> {
5959
let request_url = format!("{}/whitelist/{}", self.api_base_url, info_hash);
6060

61-
self.client.post(request_url).query(&self.token_param).send().await
61+
self.http.post(request_url).query(&self.token_param).send().await
6262
}
6363

6464
/// Remove a torrent from the tracker whitelist.
@@ -69,7 +69,7 @@ impl Client {
6969
pub async fn remove_torrent_from_whitelist(&self, info_hash: &str) -> Result<Response, Error> {
7070
let request_url = format!("{}/whitelist/{}", self.api_base_url, info_hash);
7171

72-
self.client.delete(request_url).query(&self.token_param).send().await
72+
self.http.delete(request_url).query(&self.token_param).send().await
7373
}
7474

7575
/// Retrieve a new tracker key.
@@ -80,7 +80,7 @@ impl Client {
8080
pub async fn retrieve_new_tracker_key(&self, token_valid_seconds: u64) -> Result<Response, Error> {
8181
let request_url = format!("{}/key/{}", self.api_base_url, token_valid_seconds);
8282

83-
self.client.post(request_url).query(&self.token_param).send().await
83+
self.http.post(request_url).query(&self.token_param).send().await
8484
}
8585

8686
/// Retrieve the info for one torrent.
@@ -91,7 +91,7 @@ impl Client {
9191
pub async fn get_torrent_info(&self, info_hash: &str) -> Result<Response, Error> {
9292
let request_url = format!("{}/torrent/{}", self.api_base_url, info_hash);
9393

94-
self.client.get(request_url).query(&self.token_param).send().await
94+
self.http.get(request_url).query(&self.token_param).send().await
9595
}
9696

9797
/// Retrieve the info for multiple torrents at the same time.
@@ -110,6 +110,6 @@ impl Client {
110110
query_params.push(("info_hash".to_string(), info_hash.clone()));
111111
}
112112

113-
self.client.get(request_url).query(&query_params).send().await
113+
self.http.get(request_url).query(&query_params).send().await
114114
}
115115
}

tests/environments/isolated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn ephemeral(temp_dir: &TempDir) -> config::Settings {
7979
configuration.logging.threshold = Threshold::Off; // Change to `debug` for tests debugging
8080

8181
// Ephemeral API port
82-
configuration.net.bind_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), FREE_PORT);
82+
configuration.net.bind_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), FREE_PORT);
8383

8484
// Ephemeral Importer API port
8585
configuration.tracker_statistics_importer.port = FREE_PORT;

0 commit comments

Comments
 (0)