Skip to content

Commit ec92a4c

Browse files
committed
Merge #1227: Udpate dependencies
9fa7b61 fix: clippy errors on nightly (Jose Celano) 8bb376d chore(deps): udpate dependencies (Jose Celano) Pull request description: ``` cargo update Updating crates.io index Locking 22 packages to latest compatible versions Updating bumpalo v3.16.0 -> v3.17.0 Updating cmake v0.1.52 -> v0.1.53 Updating cpufeatures v0.2.16 -> v0.2.17 Adding getrandom v0.3.1 Updating httparse v1.9.5 -> v1.10.0 Updating hyper v1.5.2 -> v1.6.0 Updating native-tls v0.2.12 -> v0.2.13 Updating openssl v0.10.68 -> v0.10.69 Updating openssl-probe v0.1.5 -> v0.1.6 Adding rand v0.9.0 Adding rand_chacha v0.9.0 Adding rand_core v0.9.0 Updating rustls-pki-types v1.10.1 -> v1.11.0 Updating ryu v1.0.18 -> v1.0.19 Updating serde_json v1.0.137 -> v1.0.138 Updating tempfile v3.15.0 -> v3.16.0 Updating unicode-ident v1.0.14 -> v1.0.16 Adding wasi v0.13.3+wasi-0.2.2 Updating winnow v0.6.24 -> v0.6.25 Adding wit-bindgen-rt v0.33.0 Adding zerocopy v0.8.14 Adding zerocopy-derive v0.8.14 ``` Top commit has no ACKs. Tree-SHA512: 0a3f8554a78e37bcf651d4ebc0074eb92ff2d95954988e3a1ea52c8e36e2aa87f89b868b848da44b0d3026b41cca46190dbce14982ec82f718e613830da62fc4
2 parents 4447c6a + 9fa7b61 commit ec92a4c

File tree

18 files changed

+178
-106
lines changed

18 files changed

+178
-106
lines changed

Cargo.lock

Lines changed: 137 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/bencode/src/mutable/bencode_mut.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ impl<'a> BRefAccess for BencodeMut<'a> {
8282
fn str(&self) -> Option<&str> {
8383
let bytes = self.bytes()?;
8484

85-
match str::from_utf8(bytes) {
86-
Ok(n) => Some(n),
87-
Err(_) => None,
88-
}
85+
str::from_utf8(bytes).ok()
8986
}
9087

9188
fn int(&self) -> Option<i64> {

contrib/bencode/src/reference/bencode_ref.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ impl<'a> BRefAccessExt<'a> for BencodeRef<'a> {
107107
fn str_ext(&self) -> Option<&'a str> {
108108
let bytes = self.bytes_ext()?;
109109

110-
match str::from_utf8(bytes) {
111-
Ok(n) => Some(n),
112-
Err(_) => None,
113-
}
110+
str::from_utf8(bytes).ok()
114111
}
115112

116113
fn bytes_ext(&self) -> Option<&'a [u8]> {

contrib/bencode/src/reference/decode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ fn decode_dict(
129129
})
130130
}
131131
_ => (),
132-
};
132+
}
133+
133134
curr_pos = next_pos;
134135

135136
let (value, next_pos) = decode(bytes, curr_pos, opts, depth + 1)?;

packages/test-helpers/src/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub fn ephemeral_ipv6() -> Configuration {
153153

154154
if let Some(ref mut http_api) = cfg.http_api {
155155
http_api.bind_address.clone_from(&ipv6);
156-
};
156+
}
157157

158158
if let Some(ref mut http_trackers) = cfg.http_trackers {
159159
http_trackers[0].bind_address.clone_from(&ipv6);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Random data generators for testing.
2-
use rand::distributions::Alphanumeric;
3-
use rand::{thread_rng, Rng};
2+
use rand::distr::Alphanumeric;
3+
use rand::{rng, Rng};
44

55
/// Returns a random alphanumeric string of a certain size.
66
///
77
/// It is useful for generating random names, IDs, etc for testing.
88
pub fn string(size: usize) -> String {
9-
thread_rng().sample_iter(&Alphanumeric).take(size).map(char::from).collect()
9+
rng().sample_iter(&Alphanumeric).take(size).map(char::from).collect()
1010
}

packages/torrent-repository/tests/common/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl Repo {
232232
Repo::DashMapMutexStd(repo) => {
233233
repo.torrents.insert(*info_hash, torrent.into());
234234
}
235-
};
235+
}
236236
self.get(info_hash).await
237237
}
238238
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Client {
6767

6868
if let Some(token) = &self.connection_info.api_token {
6969
query.add_param(QueryParam::new("token", token));
70-
};
70+
}
7171

7272
self.get_request_with_query(path, query, headers).await
7373
}

packages/tracker-client/src/udp/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub async fn check(remote_addr: &SocketAddr) -> Result<String, String> {
243243
match client.send(connect_request.into()).await {
244244
Ok(_) => (),
245245
Err(e) => tracing::debug!("Error: {e:?}."),
246-
};
246+
}
247247

248248
let process = move |response| {
249249
if matches!(response, Response::Connect(_connect_response)) {

packages/tracker-core/src/authentication/key/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use std::sync::Arc;
4545
use std::time::Duration;
4646

4747
use derive_more::Display;
48-
use rand::distributions::Alphanumeric;
49-
use rand::{thread_rng, Rng};
48+
use rand::distr::Alphanumeric;
49+
use rand::{rng, Rng};
5050
use serde::{Deserialize, Serialize};
5151
use thiserror::Error;
5252
use torrust_tracker_clock::clock::Time;
@@ -81,7 +81,7 @@ pub fn generate_permanent_key() -> PeerKey {
8181
/// * `lifetime`: if `None` the key will be permanent.
8282
#[must_use]
8383
pub fn generate_key(lifetime: Option<Duration>) -> PeerKey {
84-
let random_id: String = thread_rng()
84+
let random_id: String = rng()
8585
.sample_iter(&Alphanumeric)
8686
.take(AUTH_KEY_LENGTH)
8787
.map(char::from)

0 commit comments

Comments
 (0)