Skip to content

Commit

Permalink
Require Debug for C::Stamps
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Aug 2, 2024
1 parent f65bfe1 commit 2f526a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/array.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
use std::fmt::Debug;
use std::ops::{Deref, DerefMut};

#[derive(Copy, Clone)]
pub struct Array<T, const N: usize> {
#[derive(Copy, Clone, Debug)]
pub struct Array<T: Debug, const N: usize> {
data: [T; N],
}

impl<T, const N: usize> Array<T, N> {
impl<T: Debug, const N: usize> Array<T, N> {
pub fn new(data: [T; N]) -> Self {
Self { data }
}
}

impl<T, const N: usize> Deref for Array<T, N> {
impl<T: Debug, const N: usize> Deref for Array<T, N> {
type Target = [T];

fn deref(&self) -> &Self::Target {
&self.data
}
}

impl<T, const N: usize> DerefMut for Array<T, N> {
impl<T: Debug, const N: usize> DerefMut for Array<T, N> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.data
}
Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub trait Configuration: Any {
type Fields: Send + Sync;

/// A array of [`StampedValue<()>`](`StampedValue`) tuples, one per each of the value fields.
type Stamps: Send + Sync + DerefMut<Target = [Stamp]>;
type Stamps: Send + Sync + fmt::Debug + DerefMut<Target = [Stamp]>;
}

pub struct JarImpl<C: Configuration> {
Expand Down

0 comments on commit 2f526a5

Please sign in to comment.