Skip to content

Commit

Permalink
minor: simplify Discriminant usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tsionyx committed Dec 9, 2024
1 parent 4aafd86 commit c0868e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/connective/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::BoolFn;
use crate::{
arity::two_powers,
utils::{
dependent_array::{CheckedArray, Discriminant},
dependent_array::{CheckedArray, Discriminant as _},
upcast::{Upcast, UpcastFrom},
},
};
Expand Down Expand Up @@ -265,7 +265,7 @@ where
}

fn is_balanced(&self) -> bool {
let expected_size = <two_powers::D as Discriminant<ARITY>>::ARR_SIZE;
let expected_size = two_powers::D::ARR_SIZE;
let balanced = self.hamming_weight() * 2 == expected_size;
if balanced {
// TODO: consider checking the
Expand Down
3 changes: 1 addition & 2 deletions src/utils/dependent_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ impl<const IN: usize, ARR> VerifySize<IN, ARR> for ARR
where
ARR: CheckedArray<IN>,
{
const ASSERT_SIZE: () =
assert!(<ARR::Array<()> as SizedArray>::SIZE == <ARR as Discriminant<IN>>::ARR_SIZE);
const ASSERT_SIZE: () = assert!(<ARR::Array<()> as SizedArray>::SIZE == ARR::ARR_SIZE);
}

#[derive(Debug, Copy, Clone)]
Expand Down

0 comments on commit c0868e5

Please sign in to comment.