Skip to content

Upgrade dependencies #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ homepage = "https://github.com/RustAudio/pitch_calc"
edition = "2018"

[dependencies]
num = "0.1.28"
rand = "0.3.12"
num-traits = "0.2.11"
rand = "0.7.3"
serde = { optional = true, version = "1.0.*", features = ["derive"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/calc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::utils::modulo;
use crate::{Letter, Octave, MAX_HZ, MIN_HZ, TOTAL_LETTERS};
use num::{Float, FromPrimitive, ToPrimitive};
use num_traits::{Float, FromPrimitive, ToPrimitive};

/// Useful for conversions between Step and Hz.
const TWELFTH_ROOT_OF_TWO: f32 = 1.059463094359;
Expand Down
8 changes: 4 additions & 4 deletions src/letter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use self::Letter::{Ab, Ash, Bb, Csh, Db, Dsh, Eb, Fsh, Gb, Gsh, A, B, C, D, E, F, G};
use crate::utils::modulo;
use num::PrimInt as Int;
use num::{FromPrimitive, ToPrimitive};
use num_traits::PrimInt as Int;
use num_traits::{FromPrimitive, ToPrimitive};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
Expand Down Expand Up @@ -136,8 +136,8 @@ impl ToPrimitive for Letter {
}
}

impl ::rand::Rand for Letter {
fn rand<R: ::rand::Rng>(rng: &mut R) -> Letter {
impl ::rand::distributions::Distribution<Letter> for ::rand::distributions::Standard {
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> Letter {
rng.gen_range(0, 12).to_letter()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use num::PrimInt as Int;
use num_traits::PrimInt as Int;

/// The modulo function (handles negatives differently to Rust's remainder `%` operator).
#[inline]
Expand Down