Skip to content

Commit

Permalink
Merge pull request #15 from glandium/bitflags
Browse files Browse the repository at this point in the history
Make the use of bitflags future-proof
  • Loading branch information
padenot authored Sep 13, 2023
2 parents 39c24fc + 95f0a91 commit 0646227
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ edition = "2018"
travis-ci = { repository = "mozilla/audio-mixer" }

[dependencies]
bitflags = "1.2"
bitflags = "1.3"

[dev-dependencies]
criterion = "0.3"
Expand Down
17 changes: 5 additions & 12 deletions src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,11 @@ bitflags! {
// Avoid printing the following types in debugging context {:?} by declaring them in impl
// rather than bitflags! {} scope.
impl ChannelMap {
pub const FRONT_2: Self = Self {
bits: Self::FRONT_LEFT.bits() | Self::FRONT_RIGHT.bits(),
};
pub const BACK_2: Self = Self {
bits: Self::BACK_LEFT.bits() | Self::BACK_RIGHT.bits(),
};
pub const FRONT_2_OF_CENTER: Self = Self {
bits: Self::FRONT_LEFT_OF_CENTER.bits() | Self::FRONT_RIGHT_OF_CENTER.bits(),
};
pub const SIDE_2: Self = Self {
bits: Self::SIDE_LEFT.bits() | Self::SIDE_RIGHT.bits(),
};
pub const FRONT_2: Self = Self::union(Self::FRONT_LEFT, Self::FRONT_RIGHT);
pub const BACK_2: Self = Self::union(Self::BACK_LEFT, Self::BACK_RIGHT);
pub const FRONT_2_OF_CENTER: Self =
Self::union(Self::FRONT_LEFT_OF_CENTER, Self::FRONT_RIGHT_OF_CENTER);
pub const SIDE_2: Self = Self::union(Self::SIDE_LEFT, Self::SIDE_RIGHT);
}

impl From<Channel> for ChannelMap {
Expand Down

0 comments on commit 0646227

Please # to comment.