histogram: Inline default impls

This commit is contained in:
Vinzent Steinberg 2018-03-06 19:03:46 +01:00
parent d1ab9630af
commit 08445ba2a3

View File

@ -20,16 +20,19 @@ pub trait Histogram:
fn bins(&self) -> &[u64];
/// Return an iterator over the bins normalized by the bin widths.
#[inline]
fn normalized_bins(&self) -> IterNormalized<<&Self as IntoIterator>::IntoIter> {
IterNormalized { histogram_iter: self.into_iter() }
}
/// Return an iterator over the bin widths.
#[inline]
fn widths(&self) -> IterWidths<<&Self as IntoIterator>::IntoIter> {
IterWidths { histogram_iter: self.into_iter() }
}
/// Return an iterator over the bin centers.
#[inline]
fn centers(&self) -> IterBinCenters<<&Self as IntoIterator>::IntoIter> {
IterBinCenters { histogram_iter: self.into_iter() }
}