Skip to content

Commit 5080813

Browse files
committed
fixups
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent a21f5b1 commit 5080813

11 files changed

Lines changed: 91 additions & 75 deletions

File tree

encodings/datetime-parts/src/compute/take.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn take_datetime_parts(
6565
.seconds()
6666
.statistics()
6767
.get(Stat::Min)
68-
.map(|s| s.into_inner())
68+
.into_inner()
6969
.unwrap_or_else(|| Scalar::primitive(0i64, Nullability::NonNullable))
7070
.cast(array.seconds().dtype())?;
7171
let taken_seconds = taken_seconds.fill_null(seconds_fill)?;
@@ -74,7 +74,7 @@ fn take_datetime_parts(
7474
.subseconds()
7575
.statistics()
7676
.get(Stat::Min)
77-
.map(|s| s.into_inner())
77+
.into_inner()
7878
.unwrap_or_else(|| Scalar::primitive(0i64, Nullability::NonNullable))
7979
.cast(array.subseconds().dtype())?;
8080
let taken_subseconds = taken_subseconds.fill_null(subseconds_fill)?;

vortex-array/public-api.lock

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12072,7 +12072,7 @@ pub mod vortex_array::expr::stats
1207212072

1207312073
pub enum vortex_array::expr::stats::IntersectionResult<T>
1207412074

12075-
pub vortex_array::expr::stats::IntersectionResult::None
12075+
pub vortex_array::expr::stats::IntersectionResult::Empty
1207612076

1207712077
pub vortex_array::expr::stats::IntersectionResult::Value(T)
1207812078

@@ -12098,6 +12098,8 @@ impl<T> core::marker::StructuralPartialEq for vortex_array::expr::stats::Interse
1209812098

1209912099
pub enum vortex_array::expr::stats::Precision<T>
1210012100

12101+
pub vortex_array::expr::stats::Precision::Absent
12102+
1210112103
pub vortex_array::expr::stats::Precision::Exact(T)
1210212104

1210312105
pub vortex_array::expr::stats::Precision::Inexact(T)
@@ -12110,6 +12112,10 @@ impl vortex_array::expr::stats::Precision<vortex_array::scalar::ScalarValue>
1211012112

1211112113
pub fn vortex_array::expr::stats::Precision<vortex_array::scalar::ScalarValue>::into_scalar(self, vortex_array::dtype::DType) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
1211212114

12115+
impl<T, E> vortex_array::expr::stats::Precision<core::result::Result<T, E>>
12116+
12117+
pub fn vortex_array::expr::stats::Precision<core::result::Result<T, E>>::transpose(self) -> core::result::Result<vortex_array::expr::stats::Precision<T>, E>
12118+
1211312119
impl<T> vortex_array::expr::stats::Precision<T> where T: core::marker::Copy
1211412120

1211512121
pub fn vortex_array::expr::stats::Precision<T>::to_inexact(&self) -> Self
@@ -12128,19 +12134,19 @@ pub fn vortex_array::expr::stats::Precision<T>::inexact<S: core::convert::Into<T
1212812134

1212912135
pub fn vortex_array::expr::stats::Precision<T>::into_inexact(self) -> Self
1213012136

12131-
pub fn vortex_array::expr::stats::Precision<T>::into_inner(self) -> T
12137+
pub fn vortex_array::expr::stats::Precision<T>::into_inner(self) -> core::option::Option<T>
12138+
12139+
pub fn vortex_array::expr::stats::Precision<T>::is_absent(&self) -> bool
1213212140

1213312141
pub fn vortex_array::expr::stats::Precision<T>::is_exact(&self) -> bool
1213412142

1213512143
pub fn vortex_array::expr::stats::Precision<T>::map<U, F: core::ops::function::FnOnce(T) -> U>(self, F) -> vortex_array::expr::stats::Precision<U>
1213612144

12137-
pub fn vortex_array::expr::stats::Precision<T>::try_map<U, F: core::ops::function::FnOnce(T) -> vortex_error::VortexResult<U>>(self, F) -> vortex_error::VortexResult<vortex_array::expr::stats::Precision<U>>
12138-
1213912145
pub fn vortex_array::expr::stats::Precision<T>::zip<U>(self, vortex_array::expr::stats::Precision<U>) -> vortex_array::expr::stats::Precision<(T, U)>
1214012146

1214112147
impl<T> vortex_array::expr::stats::Precision<T>
1214212148

12143-
pub fn vortex_array::expr::stats::Precision<T>::bound<S: vortex_array::expr::stats::StatType<T>>(self) -> <S as vortex_array::expr::stats::StatType>::Bound
12149+
pub fn vortex_array::expr::stats::Precision<T>::bound<S: vortex_array::expr::stats::StatType<T>>(self) -> core::option::Option<<S as vortex_array::expr::stats::StatType>::Bound>
1214412150

1214512151
impl<T> vortex_array::expr::stats::Precision<core::option::Option<T>>
1214612152

@@ -12182,6 +12188,10 @@ pub fn vortex_array::expr::stats::Precision<T>::fmt(&self, &mut core::fmt::Forma
1218212188

1218312189
impl<T: core::marker::Copy> core::marker::Copy for vortex_array::expr::stats::Precision<T>
1218412190

12191+
impl<T> core::default::Default for vortex_array::expr::stats::Precision<T>
12192+
12193+
pub fn vortex_array::expr::stats::Precision<T>::default() -> Self
12194+
1218512195
impl<T> core::marker::StructuralPartialEq for vortex_array::expr::stats::Precision<T>
1218612196

1218712197
#[repr(u8)] pub enum vortex_array::expr::stats::Stat
@@ -12548,47 +12558,47 @@ pub const vortex_array::expr::stats::UncompressedSizeInBytes::STAT: vortex_array
1254812558

1254912559
pub trait vortex_array::expr::stats::StatsProvider
1255012560

12551-
pub fn vortex_array::expr::stats::StatsProvider::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
12561+
pub fn vortex_array::expr::stats::StatsProvider::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
1255212562

1255312563
pub fn vortex_array::expr::stats::StatsProvider::is_empty(&self) -> bool
1255412564

1255512565
pub fn vortex_array::expr::stats::StatsProvider::len(&self) -> usize
1255612566

1255712567
impl vortex_array::expr::stats::StatsProvider for vortex_array::stats::MutTypedStatsSetRef<'_, '_>
1255812568

12559-
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
12569+
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
1256012570

1256112571
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::is_empty(&self) -> bool
1256212572

1256312573
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::len(&self) -> usize
1256412574

1256512575
impl vortex_array::expr::stats::StatsProvider for vortex_array::stats::StatsSetRef<'_>
1256612576

12567-
pub fn vortex_array::stats::StatsSetRef<'_>::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
12577+
pub fn vortex_array::stats::StatsSetRef<'_>::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
1256812578

1256912579
pub fn vortex_array::stats::StatsSetRef<'_>::is_empty(&self) -> bool
1257012580

1257112581
pub fn vortex_array::stats::StatsSetRef<'_>::len(&self) -> usize
1257212582

1257312583
impl vortex_array::expr::stats::StatsProvider for vortex_array::stats::TypedStatsSetRef<'_, '_>
1257412584

12575-
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
12585+
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
1257612586

1257712587
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::is_empty(&self) -> bool
1257812588

1257912589
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::len(&self) -> usize
1258012590

1258112591
pub trait vortex_array::expr::stats::StatsProviderExt: vortex_array::expr::stats::StatsProvider
1258212592

12583-
pub fn vortex_array::expr::stats::StatsProviderExt::get_as<T: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>>(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<T>>
12593+
pub fn vortex_array::expr::stats::StatsProviderExt::get_as<T: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>>(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<T>
1258412594

1258512595
pub fn vortex_array::expr::stats::StatsProviderExt::get_as_bound<S, U>(&self) -> core::option::Option<<S as vortex_array::expr::stats::StatType>::Bound> where S: vortex_array::expr::stats::StatType<U>, U: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>
1258612596

1258712597
pub fn vortex_array::expr::stats::StatsProviderExt::get_scalar_bound<S: vortex_array::expr::stats::StatType<vortex_array::scalar::Scalar>>(&self) -> core::option::Option<<S as vortex_array::expr::stats::StatType>::Bound>
1258812598

1258912599
impl<S> vortex_array::expr::stats::StatsProviderExt for S where S: vortex_array::expr::stats::StatsProvider
1259012600

12591-
pub fn S::get_as<T: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>>(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<T>>
12601+
pub fn S::get_as<T: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>>(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<T>
1259212602

1259312603
pub fn S::get_as_bound<S, U>(&self) -> core::option::Option<<S as vortex_array::expr::stats::StatType>::Bound> where S: vortex_array::expr::stats::StatType<U>, U: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>
1259412604

@@ -20228,7 +20238,7 @@ pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::merge_unordered(self, &
2022820238

2022920239
impl vortex_array::expr::stats::StatsProvider for vortex_array::stats::MutTypedStatsSetRef<'_, '_>
2023020240

20231-
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
20241+
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
2023220242

2023320243
pub fn vortex_array::stats::MutTypedStatsSetRef<'_, '_>::is_empty(&self) -> bool
2023420244

@@ -20266,9 +20276,9 @@ impl vortex_array::stats::StatsSet
2026620276

2026720277
pub fn vortex_array::stats::StatsSet::clear(&mut self, vortex_array::expr::stats::Stat)
2026820278

20269-
pub fn vortex_array::stats::StatsSet::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::ScalarValue>>
20279+
pub fn vortex_array::stats::StatsSet::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::ScalarValue>
2027020280

20271-
pub fn vortex_array::stats::StatsSet::get_as<T: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>>(&self, vortex_array::expr::stats::Stat, &vortex_array::dtype::DType) -> core::option::Option<vortex_array::expr::stats::Precision<T>>
20281+
pub fn vortex_array::stats::StatsSet::get_as<T: for<'a> core::convert::TryFrom<&'a vortex_array::scalar::Scalar, Error = vortex_error::VortexError>>(&self, vortex_array::expr::stats::Stat, &vortex_array::dtype::DType) -> vortex_array::expr::stats::Precision<T>
2027220282

2027320283
pub fn vortex_array::stats::StatsSet::is_empty(&self) -> bool
2027420284

@@ -20390,7 +20400,7 @@ pub fn vortex_array::stats::StatsSetRef<'_>::with_typed_stats_set<U, F: core::op
2039020400

2039120401
impl vortex_array::expr::stats::StatsProvider for vortex_array::stats::StatsSetRef<'_>
2039220402

20393-
pub fn vortex_array::stats::StatsSetRef<'_>::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
20403+
pub fn vortex_array::stats::StatsSetRef<'_>::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
2039420404

2039520405
pub fn vortex_array::stats::StatsSetRef<'_>::is_empty(&self) -> bool
2039620406

@@ -20410,7 +20420,7 @@ pub vortex_array::stats::TypedStatsSetRef::values: &'a vortex_array::stats::Stat
2041020420

2041120421
impl vortex_array::expr::stats::StatsProvider for vortex_array::stats::TypedStatsSetRef<'_, '_>
2041220422

20413-
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> core::option::Option<vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>>
20423+
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::get(&self, vortex_array::expr::stats::Stat) -> vortex_array::expr::stats::Precision<vortex_array::scalar::Scalar>
2041420424

2041520425
pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::is_empty(&self) -> bool
2041620426

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ impl<T> Precision<Option<T>> {
5050
}
5151

5252
impl<T, E> Precision<Result<T, E>> {
53+
/// Transpose a `Precision<Result<T, E>>` into a `Result<Precision<T>, E>`.
5354
pub fn transpose(self) -> Result<Precision<T>, E> {
54-
todo!()
55+
match self {
56+
Self::Exact(value) => value.map(Precision::Exact),
57+
Self::Inexact(value) => value.map(Precision::Inexact),
58+
Self::Absent => Ok(Precision::Absent),
59+
}
5560
}
5661
}
5762

vortex-datafusion/src/convert/stats.rs

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,55 +27,52 @@ pub(crate) fn stats_set_to_df(
2727
// TODO(connor): There's a lot that can go wrong here, should probably handle this
2828
// more gracefully...
2929
// Find the min statistic.
30-
let min = stats_set.get(Stat::Min).and_then(|pstat_val| {
31-
pstat_val
32-
.map(|stat_val| {
33-
Scalar::try_new(
34-
Stat::Min
35-
.dtype(dtype)
36-
.vortex_expect("must have a valid dtype"),
37-
Some(stat_val),
38-
)
39-
.vortex_expect("`Stat::Min` somehow had an incompatible `DType`")
40-
.try_to_df()
41-
.ok()
42-
})
43-
.transpose()
44-
});
30+
let min = stats_set
31+
.get(Stat::Min)
32+
.map(|stat_val| {
33+
Scalar::try_new(
34+
Stat::Min
35+
.dtype(dtype)
36+
.vortex_expect("must have a valid dtype"),
37+
Some(stat_val),
38+
)
39+
.vortex_expect("`Stat::Min` somehow had an incompatible `DType`")
40+
.try_to_df()
41+
.ok()
42+
})
43+
.transpose();
4544

4645
// Find the max statistic.
47-
let max = stats_set.get(Stat::Max).and_then(|pstat_val| {
48-
pstat_val
49-
.map(|stat_val| {
50-
Scalar::try_new(
51-
Stat::Max
52-
.dtype(dtype)
53-
.vortex_expect("must have a valid dtype"),
54-
Some(stat_val),
55-
)
56-
.vortex_expect("`Stat::Max` somehow had an incompatible `DType`")
57-
.try_to_df()
58-
.ok()
59-
})
60-
.transpose()
61-
});
46+
let max = stats_set
47+
.get(Stat::Max)
48+
.map(|stat_val| {
49+
Scalar::try_new(
50+
Stat::Max
51+
.dtype(dtype)
52+
.vortex_expect("must have a valid dtype"),
53+
Some(stat_val),
54+
)
55+
.vortex_expect("`Stat::Max` somehow had an incompatible `DType`")
56+
.try_to_df()
57+
.ok()
58+
})
59+
.transpose();
6260

6361
// Find the sum statistic
64-
let sum = stats_set.get(Stat::Sum).and_then(|pstat_val| {
65-
pstat_val
66-
.map(|stat_val| {
67-
Scalar::try_new(
68-
Stat::Sum
69-
.dtype(dtype)
70-
.vortex_expect("must have a valid dtype"),
71-
Some(stat_val),
72-
)
73-
.vortex_expect("`Stat::Sum` somehow had an incompatible `DType`")
74-
.try_to_df()
75-
.ok()
76-
})
77-
.transpose()
78-
});
62+
let sum = stats_set
63+
.get(Stat::Sum)
64+
.map(|stat_val| {
65+
Scalar::try_new(
66+
Stat::Sum
67+
.dtype(dtype)
68+
.vortex_expect("must have a valid dtype"),
69+
Some(stat_val),
70+
)
71+
.vortex_expect("`Stat::Sum` somehow had an incompatible `DType`")
72+
.try_to_df()
73+
.ok()
74+
})
75+
.transpose();
7976

8077
let null_count = stats_set.get_as::<usize>(Stat::NullCount, &PType::U64.into());
8178

@@ -92,9 +89,9 @@ pub(crate) fn stats_set_to_df(
9289
}
9390

9491
pub(crate) fn is_constant_to_distinct_count(
95-
is_constant: Option<VortexPrecision<bool>>,
92+
is_constant: VortexPrecision<bool>,
9693
) -> Precision<usize> {
97-
match is_constant.and_then(VortexPrecision::as_exact) {
94+
match is_constant.as_exact() {
9895
Some(true) => Precision::Exact(1),
9996
Some(false) | None => Precision::Absent,
10097
}

vortex-datafusion/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ where
119119
match self {
120120
Precision::Exact(v) => DFPrecision::Exact(v),
121121
Precision::Inexact(v) => DFPrecision::Inexact(v),
122+
Precision::Absent => DFPrecision::Absent,
122123
}
123124
}
124125
}

vortex-datafusion/src/persistent/format.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,18 +639,19 @@ impl FileFormat for VortexFormat {
639639

640640
fn scalar_stat_to_df(
641641
stat: Stat,
642-
value: Option<stats::Precision<VortexScalarValue>>,
642+
value: stats::Precision<VortexScalarValue>,
643643
stats_dtype: &DType,
644644
target_dtype: &DType,
645645
) -> Option<stats::Precision<DFScalarValue>> {
646646
let stat_dtype = stat.dtype(stats_dtype)?;
647647

648-
value?
649-
.try_map(|stat_value| {
648+
value
649+
.map(|stat_value| {
650650
Scalar::try_new(stat_dtype, Some(stat_value))?
651651
.cast(target_dtype)?
652652
.try_to_df()
653653
})
654+
.transpose()
654655
.ok()
655656
}
656657

vortex-file/src/pruning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn extract_relevant_file_stats_as_struct_row(
6060
stat,
6161
Stat::Max | Stat::Min | Stat::NaNCount | Stat::NullCount
6262
) {
63-
let Some(stat_value) = typed_stats.get(*stat).and_then(|p| p.as_exact()) else {
63+
let Some(stat_value) = typed_stats.get(*stat).as_exact() else {
6464
vortex_bail!("missing stat {}, {} from stats set", field, stat)
6565
};
6666
columns.push((

vortex-file/src/v2/file_stats_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl StatsCatalog for FileStatsLayoutReader {
132132
let field_idx = self.struct_fields.find(field_name)?;
133133
let field_stats = self.file_stats.stats_sets().get(field_idx)?;
134134

135-
let stat_value = field_stats.get(stat)?.as_exact()?;
135+
let stat_value = field_stats.get(stat).as_exact()?;
136136
let field_dtype = self.struct_fields.field_by_index(field_idx)?;
137137
let stat_dtype = stat.dtype(&field_dtype)?;
138138
let stat_scalar = Scalar::try_new(stat_dtype, Some(stat_value)).ok()?;

vortex-flatbuffers/public-api.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ pub fn vortex_flatbuffers::array::Compression::run_verifier(&mut flatbuffers::ve
450450

451451
impl vortex_flatbuffers::array::Precision
452452

453+
pub const vortex_flatbuffers::array::Precision::Absent: Self
454+
453455
pub const vortex_flatbuffers::array::Precision::ENUM_MAX: u8
454456

455457
pub const vortex_flatbuffers::array::Precision::ENUM_MIN: u8
@@ -532,7 +534,7 @@ pub const vortex_flatbuffers::array::ENUM_MIN_PRECISION: u8
532534

533535
pub const vortex_flatbuffers::array::ENUM_VALUES_COMPRESSION: [vortex_flatbuffers::array::Compression; 2]
534536

535-
pub const vortex_flatbuffers::array::ENUM_VALUES_PRECISION: [vortex_flatbuffers::array::Precision; 2]
537+
pub const vortex_flatbuffers::array::ENUM_VALUES_PRECISION: [vortex_flatbuffers::array::Precision; 3]
536538

537539
pub fn vortex_flatbuffers::array::finish_array_buffer<'a, 'b, A: flatbuffers::builder::Allocator + 'a>(&'b mut flatbuffers::builder::FlatBufferBuilder<'a, A>, flatbuffers::primitives::WIPOffset<vortex_flatbuffers::array::Array<'a>>)
538540

vortex-layout/src/layouts/flat/writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ fn truncate_scalar_stat<F: Fn(Scalar) -> Option<(Scalar, bool)>>(
8181
stat: Stat,
8282
truncation: F,
8383
) {
84-
if let Some(sv) = statistics.get(stat) {
85-
if let Some((truncated_value, truncated)) = truncation(sv.into_inner()) {
84+
if let Some(sv) = statistics.get(stat).into_inner() {
85+
if let Some((truncated_value, truncated)) = truncation(sv) {
8686
if truncated && let Some(v) = truncated_value.into_value() {
8787
statistics.set(stat, Precision::Inexact(v));
8888
}

0 commit comments

Comments
 (0)