Skip to content

Commit 34e5d4c

Browse files
Merge pull request #24 from mitchmindtree/update-deps
feat: Update `num` and `rand` deps to latest versions. Publish 0.14.
2 parents 8384ddf + 580348a commit 34e5d4c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
22
name = "time_calc"
33
description = "A library for music/DSP time conversions! Provides functions and methods for converting between ticks, ms, samples, bars, beats and measures."
4-
version = "0.13.0"
4+
version = "0.14.0"
5+
edition = "2021"
56
authors = ["[email protected]"]
67
readme = "README.md"
78
keywords = ["time", "dsp", "audio", "music", "conversion"]
@@ -10,6 +11,6 @@ repository = "https://github.com/RustAudio/time_calc.git"
1011
homepage = "https://github.com/RustAudio/time_calc"
1112

1213
[dependencies]
13-
num = "0.1.28"
14-
rand = "0.3.12"
14+
num = "0.4.3"
15+
rand = { version = "0.9.0", default-features = false }
1516
serde = { optional = true, version = "1.0", features = ["serde_derive"] }

src/division.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,13 @@ impl NumCast for DivType {
171171
}
172172
}
173173

174-
impl ::rand::Rand for DivType {
175-
fn rand<R: ::rand::Rng>(rng: &mut R) -> DivType {
176-
let rand: bool = rng.gen();
177-
if rand { DivType::Whole } else { DivType::TwoThirds }
174+
impl rand::distr::Distribution<DivType> for rand::distr::StandardUniform {
175+
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> DivType {
176+
if rng.random::<bool>() {
177+
DivType::Whole
178+
} else {
179+
DivType::TwoThirds
180+
}
178181
}
179182
}
180183

src/time_sig.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use {Bars, Ppqn, Ticks};
1+
use crate::{Bars, Ppqn, Ticks};
22

33
pub type Top = u16;
44
pub type Bottom = u16;

0 commit comments

Comments
 (0)