Skip to content

Commit

Permalink
trait EnumKey: Use Self::COUNT for the const generic parameter du…
Browse files Browse the repository at this point in the history
…ring `impl`s.
  • Loading branch information
kkysen committed Nov 27, 2023
1 parent 0520a77 commit 61e77a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/dav1d/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub(crate) enum Rav1dPixelLayout {
I444,
}

impl EnumKey<4> for Rav1dPixelLayout {
impl EnumKey<{ Self::COUNT }> for Rav1dPixelLayout {
const VALUES: [Self; Self::COUNT] = [Self::I400, Self::I420, Self::I422, Self::I444];

fn as_usize(self) -> usize {
Expand Down Expand Up @@ -260,7 +260,7 @@ pub(crate) enum Rav1dPixelLayoutSubSampled {
I444,
}

impl EnumKey<3> for Rav1dPixelLayoutSubSampled {
impl EnumKey<{ Self::COUNT }> for Rav1dPixelLayoutSubSampled {
const VALUES: [Self; Self::COUNT] = [Self::I420, Self::I422, Self::I444];

fn as_usize(self) -> usize {
Expand Down

0 comments on commit 61e77a0

Please sign in to comment.