Skip to content

Commit

Permalink
Simplify type bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
matsjoyce-refeyn committed Sep 22, 2023
1 parent bd4631b commit c87c779
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/measurements.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
use ndarray::{s, Array3, ArrayBase, Axis, Data, Ix3, Zip};
use num_traits::{Bounded, FromPrimitive, Num, NumAssignOps, ToPrimitive, Unsigned};
use num_traits::{Bounded, FromPrimitive, NumAssignOps, ToPrimitive, Unsigned};

use crate::Mask;

pub trait LabelType:
Copy + Num + FromPrimitive + ToPrimitive + Ord + Unsigned + NumAssignOps + Bounded
Copy + FromPrimitive + ToPrimitive + Ord + Unsigned + NumAssignOps + Bounded
{
fn background() -> Self;
fn foreground() -> Self;
}

impl<T> LabelType for T
where
T: Copy + Num + FromPrimitive + ToPrimitive + Ord + Unsigned + NumAssignOps + Bounded,
std::ops::Range<T>: Iterator,
T: Copy + FromPrimitive + ToPrimitive + Ord + Unsigned + NumAssignOps + Bounded,
{
fn background() -> Self {
T::zero()
Expand Down

0 comments on commit c87c779

Please sign in to comment.