Skip to content

Commit 4db62c0

Browse files
committed
feat[array]: validity in display array
Signed-off-by: Joe Isaacs <[email protected]>
1 parent fc8f8cf commit 4db62c0

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

vortex-array/src/display/tree.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ impl fmt::Display for StatsDisplay<'_> {
5353
}
5454

5555
// NaN count (only if > 0)
56-
if let Some(nan) = stats.get(Stat::NaNCount) {
57-
if let Ok(n) = usize::try_from(&nan.clone().into_inner()) {
58-
if n > 0 {
59-
sep(f)?;
60-
write!(f, "nan={}", n)?;
61-
}
62-
}
56+
if let Some(nan) = stats.get(Stat::NaNCount)
57+
&& let Ok(n) = usize::try_from(&nan.into_inner())
58+
&& n > 0
59+
{
60+
sep(f)?;
61+
write!(f, "nan={}", n)?;
6362
}
6463

6564
// Min/Max
@@ -79,22 +78,22 @@ impl fmt::Display for StatsDisplay<'_> {
7978
}
8079

8180
// Boolean flags (compact)
82-
if let Some(c) = stats.get(Stat::IsConstant) {
83-
if bool::try_from(&c.into_inner()).unwrap_or(false) {
84-
sep(f)?;
85-
f.write_str("const")?;
86-
}
81+
if let Some(c) = stats.get(Stat::IsConstant)
82+
&& bool::try_from(&c.into_inner()).unwrap_or(false)
83+
{
84+
sep(f)?;
85+
f.write_str("const")?;
8786
}
8887
if let Some(s) = stats.get(Stat::IsStrictSorted) {
8988
if bool::try_from(&s.into_inner()).unwrap_or(false) {
9089
sep(f)?;
9190
f.write_str("strict")?;
9291
}
93-
} else if let Some(s) = stats.get(Stat::IsSorted) {
94-
if bool::try_from(&s.into_inner()).unwrap_or(false) {
95-
sep(f)?;
96-
f.write_str("sorted")?;
97-
}
92+
} else if let Some(s) = stats.get(Stat::IsSorted)
93+
&& bool::try_from(&s.into_inner()).unwrap_or(false)
94+
{
95+
sep(f)?;
96+
f.write_str("sorted")?;
9897
}
9998

10099
// Close bracket if we wrote anything

0 commit comments

Comments
 (0)