Skip to content

Commit

Permalink
Merge pull request #24 from mitchmindtree/update-deps
Browse files Browse the repository at this point in the history
feat: Update `num` and `rand` deps to latest versions. Publish 0.14.
  • Loading branch information
mitchmindtree authored Feb 3, 2025
2 parents 8384ddf + 580348a commit 34e5d4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "time_calc"
description = "A library for music/DSP time conversions! Provides functions and methods for converting between ticks, ms, samples, bars, beats and measures."
version = "0.13.0"
version = "0.14.0"
edition = "2021"
authors = ["mitchell.nordine@gmail.com"]
readme = "README.md"
keywords = ["time", "dsp", "audio", "music", "conversion"]
Expand All @@ -10,6 +11,6 @@ repository = "https://github.com/RustAudio/time_calc.git"
homepage = "https://github.com/RustAudio/time_calc"

[dependencies]
num = "0.1.28"
rand = "0.3.12"
num = "0.4.3"
rand = { version = "0.9.0", default-features = false }
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
11 changes: 7 additions & 4 deletions src/division.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,13 @@ impl NumCast for DivType {
}
}

impl ::rand::Rand for DivType {
fn rand<R: ::rand::Rng>(rng: &mut R) -> DivType {
let rand: bool = rng.gen();
if rand { DivType::Whole } else { DivType::TwoThirds }
impl rand::distr::Distribution<DivType> for rand::distr::StandardUniform {
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> DivType {
if rng.random::<bool>() {
DivType::Whole
} else {
DivType::TwoThirds
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/time_sig.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use {Bars, Ppqn, Ticks};
use crate::{Bars, Ppqn, Ticks};

pub type Top = u16;
pub type Bottom = u16;
Expand Down

0 comments on commit 34e5d4c

Please sign in to comment.