Skip to content

Commit 5633ece

Browse files
committed
Updated dependencies and switched to 2024 edition
1 parent 1bc2f5b commit 5633ece

File tree

6 files changed

+24
-67
lines changed

6 files changed

+24
-67
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[target.'cfg(target_family = "wasm")']
2-
rustflags = ["--cfg=web_sys_unstable_apis"]
2+
rustflags = ["--cfg=web_sys_unstable_apis", "--cfg=getrandom_backend=\"wasm_js\""]
33

44
# Enable for testing WASM-only stuff
55
[build]

Cargo.toml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "minidisc"
33
version = "0.1.3"
4-
edition = "2021"
4+
edition = "2024"
55
homepage = "https://github.com/G2-Games/minidisc-rs/"
66
repository = "https://github.com/G2-Games/minidisc-rs/"
77
documentation = "https://docs.rs/cross_usb"
@@ -28,30 +28,29 @@ targets = [
2828
crate-type = ["cdylib", "rlib"]
2929

3030
[dev-dependencies]
31-
tokio-test = "0.4.3"
31+
tokio-test = "0.4"
3232

3333
[dependencies]
34-
diacritics = "0.2.0"
35-
encoding_rs = "0.8.33"
36-
nofmt = "1.0.0"
37-
once_cell = "1.18.0"
38-
unicode-normalization = "0.1.22"
39-
regex = "1.10"
34+
diacritics = "0.2"
35+
encoding_rs = "0.8"
36+
nofmt = "1.0"
37+
unicode-normalization = "0.1"
38+
regex = "1.11"
4039
cross_usb = "0.4"
41-
num-derive = "0.4.2"
42-
num-traits = "0.2.14"
43-
rand = "0.8.5"
44-
getrandom = { version = "0.2", features = ["js"] }
40+
num-derive = "0.4"
41+
num-traits = "0.2"
42+
rand = "0.9"
43+
getrandom = { version = "0.3", features = ["wasm_js"] }
4544
des = "0.8"
4645
cbc = "0.1"
4746
ecb = "0.1"
48-
tokio = { version = "1.36", features = ["full", "sync"] }
49-
g2-unicode-jp = "0.4.1"
50-
thiserror = "1.0.57"
51-
phf = { version = "0.11.2", features = ["phf_macros", "macros"] }
52-
byteorder = "1.5.0"
53-
log = "0.4.22"
47+
tokio = { version = "1.36", features = ["sync"] }
48+
g2-unicode-jp = "0.4"
49+
thiserror = "2.0"
50+
phf = { version = "0.12", features = ["phf_macros", "macros"] }
51+
byteorder = "1.5"
52+
log = "0.4"
5453

5554
[target.'cfg(target_family = "wasm")'.dependencies]
5655
gloo = { version = "0.11.0", features = ["futures", "worker"] }
57-
futures = "0.3.30"
56+
futures = "0.3"

src/main.rs

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/netmd/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg_attr(debug_assertions, allow(dead_code))]
2+
use std::sync::LazyLock;
23
use std::time::Duration;
34

4-
use once_cell::sync::Lazy;
55
use thiserror::Error;
66

77
// USB stuff
@@ -67,7 +67,7 @@ pub static DEVICE_IDS: &[DeviceId] = &[
6767
}
6868

6969
/// Device IDs for use with [cross_usb]
70-
pub static DEVICE_IDS_CROSSUSB: Lazy<Box<[cross_usb::DeviceFilter]>> = Lazy::new(|| {
70+
pub static DEVICE_IDS_CROSSUSB: LazyLock<Box<[cross_usb::DeviceFilter]>> = LazyLock::new(|| {
7171
DEVICE_IDS
7272
.iter()
7373
.map(|d| {

src/netmd/encryption.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl Encryptor {
3636

3737
// Create the random key
3838
let mut random_key = [0u8; 8];
39-
rand::thread_rng().fill_bytes(&mut random_key);
39+
rand::rng().fill_bytes(&mut random_key);
4040

4141
// Encrypt it with the kek
4242
let mut encrypted_random_key = random_key;
@@ -101,7 +101,7 @@ impl Encryptor {
101101

102102
// Create the random key
103103
let mut random_key = [0u8; 8];
104-
rand::thread_rng().fill_bytes(&mut random_key);
104+
rand::rng().fill_bytes(&mut random_key);
105105

106106
// Encrypt it with the kek
107107
let mut encrypted_random_key = random_key;

src/netmd/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ impl<'a> MDSession<'a> {
19581958
)
19591959
.await?;
19601960
let mut nonce = vec![0u8; 8];
1961-
rand::thread_rng().fill_bytes(&mut nonce);
1961+
rand::rng().fill_bytes(&mut nonce);
19621962

19631963
let mut devnonce = self.md.session_key_exchange(nonce.clone()).await?;
19641964
nonce.append(&mut devnonce);

0 commit comments

Comments
 (0)