Skip to content

Commit 024dacb

Browse files
committed
more fixes
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent e6d5eae commit 024dacb

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

vortex-array/src/expr/stats/bound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<T: PartialOrd> PartialOrd<T> for UpperBound<T> {
248248
Some(o)
249249
}
250250
}),
251-
Absent => return None,
251+
Absent => None,
252252
}
253253
}
254254
}

vortex-array/src/expr/stats/precision.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,14 @@ use crate::scalar::ScalarValue;
2222
/// This is statistic specific, for max this will be an upper bound. Meaning that the actual max
2323
/// in an array is guaranteed to be less than or equal to the inexact value, but equal to the exact
2424
/// value.
25-
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
25+
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
2626
pub enum Precision<T> {
2727
Exact(T),
2828
Inexact(T),
29+
#[default]
2930
Absent,
3031
}
3132

32-
impl<T> Default for Precision<T> {
33-
fn default() -> Self {
34-
Self::Absent
35-
}
36-
}
37-
3833
impl<T> Precision<Option<T>> {
3934
/// Transpose the `Precision<Option<T>>` into `Option<Precision<T>>`.
4035
pub fn transpose(self) -> Option<Precision<T>> {

vortex-cuda/src/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ fn truncate_scalar_stat<F: Fn(Scalar) -> Option<(Scalar, bool)>>(
434434
stat: Stat,
435435
truncation: F,
436436
) {
437-
if let Some(sv) = statistics.get(stat) {
438-
if let Some((truncated_value, truncated)) = truncation(sv.into_inner()) {
437+
if let Some(sv) = statistics.get(stat).into_inner() {
438+
if let Some((truncated_value, truncated)) = truncation(sv) {
439439
if truncated && let Some(v) = truncated_value.into_value() {
440440
statistics.set(stat, Precision::Inexact(v));
441441
}

0 commit comments

Comments
 (0)