From 28292c3a834de6284955851af0bba7294b32a0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 13 Dec 2025 18:19:05 +0200 Subject: [PATCH] Update to bitflags 2 --- Cargo.lock.msrv | 14 ++++++++++---- Cargo.toml | 2 +- src/ebur128.rs | 9 +++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index e121c36..73cf651 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -40,6 +40,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + [[package]] name = "bumpalo" version = "3.16.0" @@ -97,7 +103,7 @@ version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "bitflags", + "bitflags 1.3.2", "clap_lex", "indexmap", "textwrap", @@ -214,15 +220,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e077e29310bf97aabb3cddffdbe408e1a1e32e65d27c97f5a463d57f91a36c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", ] [[package]] name = "ebur128" -version = "0.1.8" +version = "0.1.10" dependencies = [ - "bitflags", + "bitflags 2.10.0", "cc", "criterion", "dasp_frame", diff --git a/Cargo.toml b/Cargo.toml index 46d242f..d5de458 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" rust-version = "1.60" [dependencies] -bitflags = "1.0" +bitflags = "2.0" smallvec = "1.0" dasp_sample = "0.11" dasp_frame = "0.11" diff --git a/src/ebur128.rs b/src/ebur128.rs index ff7b88c..7ed4a89 100644 --- a/src/ebur128.rs +++ b/src/ebur128.rs @@ -55,18 +55,19 @@ bitflags! { /// /// Use these values in [`EbuR128::new`](struct.EbuR128.html#method.new). Try to use the lowest /// possible modes that suit your needs, as performance will be better. + #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct Mode: u8 { /// can call [`EbuR128::loudness_momentary`](struct.EbuR128.html#method.loudness_momentary) const M = 0b00000001; /// can call [`EbuR128::loudness_shortterm`](struct.EbuR128.html#method.loudness_shortterm) - const S = 0b00000010 | Mode::M.bits; + const S = 0b00000010 | Mode::M.bits(); /// can call [`EbuR128::loudness_global`](struct.EbuR128.html#method.loudness_global) and /// [`EbuR128::relative_threshold`](struct.EbuR128.html#method.relative_threshold) - const I = 0b00000100 | Mode::M.bits; + const I = 0b00000100 | Mode::M.bits(); /// can call [`EbuR128::loudness_range`](struct.EbuR128.html#method.loudness_range) - const LRA = 0b00001000 | Mode::S.bits; + const LRA = 0b00001000 | Mode::S.bits(); /// can call [`EbuR128::sample_peak`](struct.EbuR128.html#method.sample_peak) - const SAMPLE_PEAK = 0b00010000 | Mode::M.bits; + const SAMPLE_PEAK = 0b00010000 | Mode::M.bits(); /// can call [`EbuR128::true_peak`](struct.EbuR128.html#method.true_peak) const TRUE_PEAK = 0b00110001; /// uses histogram algorithm to calculate loudness