Skip to content

Commit

Permalink
Implement Clone and Debug for all iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
vks committed Apr 30, 2021
1 parent e28c1d8 commit 2ccec15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ macro_rules! define_histogram_common {
}

/// Iterate over all `(range, count)` pairs in the histogram.
#[derive(Debug, Clone)]
pub struct IterHistogram<'a> {
remaining_bin: &'a [u64],
remaining_range: &'a [f64],
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#![no_std]
#![forbid(unsafe_code)]
#![forbid(missing_docs)]
#![forbid(missing_debug_implementations)]

#![cfg_attr(feature = "nightly",
feature(const_generics, const_evaluatable_checked))]
Expand Down
4 changes: 4 additions & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub trait Histogram:
}

/// Iterate over the bins normalized by bin width.
#[derive(Debug, Clone)]
pub struct IterNormalized<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -114,6 +115,7 @@ impl<T> Iterator for IterNormalized<T>
}

/// Iterate over the widths of the bins.
#[derive(Debug, Clone)]
pub struct IterWidths<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -132,6 +134,7 @@ impl<T> Iterator for IterWidths<T>
}

/// Iterate over the bin centers.
#[derive(Debug, Clone)]
pub struct IterBinCenters<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -150,6 +153,7 @@ impl<T> Iterator for IterBinCenters<T>
}

/// Iterate over the variances.
#[derive(Debug, Clone)]
pub struct IterVariances<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand Down

0 comments on commit 2ccec15

Please sign in to comment.