diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb10f9..7eda21f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * [breaking] The control pipe is now provided in the `UsbDeviceBuilder` API to allow for user-provided control pipes. This makes it so that control pipes have configurable sizing. * Don't require UsbBus to be Sync. If a UsbBus is not Sync, it can still be used to make a UsbDevice, but that UsbDevice will not be Sync (ensuring soundness). +* Update `defmt` to version 1. +* Update `rand` to version 0.10. ## [0.3.2] - 2024-03-06 diff --git a/Cargo.toml b/Cargo.toml index 33d1d6c..b1332c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,14 +10,14 @@ authors = ["Matti Virkkunen "] repository = "https://github.com/rust-embedded-community/usb-device" [dependencies] -defmt = { version = "0.3", optional = true } +defmt = { version = "1", optional = true } portable-atomic = { version = "1.2.0", default-features = false } heapless = "0.8" log = { version = "0.4", default-features = false, optional = true} [dev-dependencies] rusb = "0.9.1" -rand = "0.8.5" +rand = { version = "0.10", features = ["thread_rng"] } [features] diff --git a/tests/test_class_host/device.rs b/tests/test_class_host/device.rs index d204985..80282a7 100644 --- a/tests/test_class_host/device.rs +++ b/tests/test_class_host/device.rs @@ -60,7 +60,7 @@ pub fn open_device(ctx: &Context) -> rusb::Result { continue; } - let mut handle = device.open()?; + let handle = device.open()?; let langs = handle.read_languages(TIMEOUT)?; if langs.is_empty() || langs[0].lang_id() != EN_US { diff --git a/tests/test_class_host/tests.rs b/tests/test_class_host/tests.rs index f745a1d..8ae0528 100644 --- a/tests/test_class_host/tests.rs +++ b/tests/test_class_host/tests.rs @@ -1,5 +1,6 @@ use crate::device::*; use rand::prelude::*; +use rand::rngs::ThreadRng; use rusb::{request_type, Direction, Recipient, RequestType, TransferType}; use std::cmp::max; use std::fmt::Write; @@ -31,11 +32,11 @@ macro_rules! tests { tests! { fn control_request(dev, _out) { - let mut rng = rand::thread_rng(); + let mut rng = ThreadRng::default(); - let value: u16 = rng.gen(); - let index: u16 = rng.gen(); - let data = random_data(rng.gen_range(0..16)); + let value: u16 = rng.random(); + let index: u16 = rng.random(); + let data = random_data(rng.random_range(0..16)); let mut expected = [0u8; 8]; expected[0] = 0x02_u8 << 5; @@ -318,6 +319,6 @@ fn run_bench(dev: &DeviceHandles, out: &mut String, f: impl Fn(&mut [u8])) { fn random_data(len: usize) -> Vec { let mut data = vec![0u8; len]; - rand::thread_rng().fill(data.as_mut_slice()); + ThreadRng::default().fill(data.as_mut_slice()); data }