define_histogram: Fix potential issue

This commit is contained in:
Vinzent Steinberg 2018-07-24 18:58:17 +02:00
parent 5807e211dc
commit ee110a774f
1 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ macro_rules! define_histogram {
/// Return the ranges of the histogram. /// Return the ranges of the histogram.
#[inline] #[inline]
pub fn ranges(&self) -> &[f64] { pub fn ranges(&self) -> &[f64] {
&self.range as &[f64] &self.range[..]
} }
/// Return an iterator over the bins and corresponding ranges: /// Return an iterator over the bins and corresponding ranges:
@ -207,7 +207,7 @@ macro_rules! define_histogram {
impl $crate::Histogram for Histogram { impl $crate::Histogram for Histogram {
#[inline] #[inline]
fn bins(&self) -> &[u64] { fn bins(&self) -> &[u64] {
&self.bin as &[u64] &self.bin[..]
} }
} }